summaryrefslogtreecommitdiff
path: root/src/caja-pathbar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/caja-pathbar.c')
-rw-r--r--src/caja-pathbar.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c
index b5504fc9..6a582014 100644
--- a/src/caja-pathbar.c
+++ b/src/caja-pathbar.c
@@ -39,6 +39,10 @@
#include "caja-window-private.h"
#include "caja-window-slot.h"
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
enum
{
PATH_CLICKED,
@@ -493,7 +497,8 @@ caja_path_bar_size_request (GtkWidget *widget,
for (list = path_bar->button_list; list; list = list->next)
{
button_data = BUTTON_DATA (list->data);
- gtk_widget_size_request (button_data->button, &child_requisition);
+ gtk_widget_get_preferred_size (button_data->button,
+ &child_requisition, NULL);
requisition->width = MAX (child_requisition.width, requisition->width);
requisition->height = MAX (child_requisition.height, requisition->height);
}
@@ -508,8 +513,10 @@ caja_path_bar_size_request (GtkWidget *widget,
requisition->width += (path_bar->spacing + path_bar->slider_width) * 2;
}
- gtk_widget_size_request (path_bar->up_slider_button, &child_requisition);
- gtk_widget_size_request (path_bar->down_slider_button, &child_requisition);
+ gtk_widget_get_preferred_size (path_bar->up_slider_button,
+ &child_requisition, NULL);
+ gtk_widget_get_preferred_size (path_bar->down_slider_button,
+ &child_requisition, NULL);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width += border_width * 2;
@@ -601,13 +608,14 @@ caja_path_bar_size_allocate (GtkWidget *widget,
width = 0;
}
- gtk_widget_get_child_requisition (BUTTON_DATA (path_bar->button_list->data)->button, &child_requisition);
+ gtk_widget_get_preferred_size (BUTTON_DATA (path_bar->button_list->data)->button,
+ &child_requisition, NULL);
width += child_requisition.width;
for (list = path_bar->button_list->next; list; list = list->next)
{
child = BUTTON_DATA (list->data)->button;
- gtk_widget_get_child_requisition (child, &child_requisition);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
width += child_requisition.width + path_bar->spacing;
if (list == path_bar->fake_root)
@@ -649,13 +657,14 @@ caja_path_bar_size_allocate (GtkWidget *widget,
* button, then count backwards.
*/
/* Count down the path chain towards the end. */
- gtk_widget_get_child_requisition (BUTTON_DATA (first_button->data)->button, &child_requisition);
+ gtk_widget_get_preferred_size (BUTTON_DATA (first_button->data)->button,
+ &child_requisition, NULL);
width = child_requisition.width;
list = first_button->prev;
while (list && !reached_end)
{
child = BUTTON_DATA (list->data)->button;
- gtk_widget_get_child_requisition (child, &child_requisition);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
{
@@ -681,7 +690,7 @@ caja_path_bar_size_allocate (GtkWidget *widget,
while (first_button->next && ! reached_end)
{
child = BUTTON_DATA (first_button->next->data)->button;
- gtk_widget_get_child_requisition (child, &child_requisition);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width)
{
@@ -725,7 +734,7 @@ caja_path_bar_size_allocate (GtkWidget *widget,
for (list = first_button; list; list = list->prev)
{
child = BUTTON_DATA (list->data)->button;
- gtk_widget_get_child_requisition (child, &child_requisition);
+ gtk_widget_get_preferred_size (child, &child_requisition, NULL);
gtk_widget_get_allocation (widget, &widget_allocation);