[nautilus] Use gtk_size_request_get_size()



commit 36836b7dc517a588b34117e05a45bc4026e77f71
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sun Sep 19 12:24:31 2010 +0200

    Use gtk_size_request_get_size()

 eel/eel-editable-label.c                           |    2 +-
 libnautilus-private/nautilus-horizontal-splitter.c |    7 +++--
 libnautilus-private/nautilus-icon-container.c      |    3 +-
 src/nautilus-pathbar.c                             |   27 +++++++++++++------
 src/nautilus-side-pane.c                           |    6 +++-
 src/nautilus-spatial-window.c                      |    6 +++-
 src/nautilus-zoom-control.c                        |    6 +++-
 7 files changed, 37 insertions(+), 20 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 1a59690..3256422 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1209,7 +1209,7 @@ get_layout_location (EelEditableLabel  *label,
   if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
     xalign = 1.0 - xalign;
 
-  gtk_widget_get_child_requisition (widget, &req);
+  gtk_size_request_get_size (GTK_SIZE_REQUEST (widget), &req, NULL);
   gtk_misc_get_padding (misc, &xpad, &ypad);
 
   gtk_widget_get_allocation (widget, &allocation);
diff --git a/libnautilus-private/nautilus-horizontal-splitter.c b/libnautilus-private/nautilus-horizontal-splitter.c
index fa09d87..ace3493 100644
--- a/libnautilus-private/nautilus-horizontal-splitter.c
+++ b/libnautilus-private/nautilus-horizontal-splitter.c
@@ -247,9 +247,10 @@ nautilus_horizontal_splitter_size_allocate (GtkWidget     *widget,
 			gdk_window_hide (gtk_paned_get_handle_window (paned));
 		}
 
-		gtk_widget_get_child_requisition (gtk_paned_get_child1 (paned),
-						  &child_requisition);
-		
+		gtk_size_request_get_size (GTK_SIZE_REQUEST (gtk_paned_get_child1 (paned)),
+					   &child_requisition,
+					   NULL);
+
 		child_allocation.x = allocation->x + border_width;
 		child_allocation.y = allocation->y + border_width;
 		child_allocation.width = MIN (child_requisition.width,
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index a7d4b76..484f7c2 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -4787,7 +4787,8 @@ nautilus_icon_container_search_position_func (NautilusIconContainer *container,
 
 	gdk_window_get_origin (cont_window, &cont_x, &cont_y);
 	gdk_drawable_get_size (cont_window, &cont_width, &cont_height);
-	gtk_widget_size_request (search_dialog, &requisition);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (search_dialog),
+				   &requisition, NULL);
 
 	if (cont_x + cont_width - requisition.width > gdk_screen_get_width (screen)) {
 		x = gdk_screen_get_width (screen) - requisition.width;
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 08c1304..fb51906 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -477,7 +477,8 @@ nautilus_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_size_request_get_size (GTK_SIZE_REQUEST (button_data->button),
+							     &child_requisition, NULL);
                 requisition->width = MAX (child_requisition.width, requisition->width);
                 requisition->height = MAX (child_requisition.height, requisition->height);
         }
@@ -491,8 +492,10 @@ nautilus_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_size_request_get_size (GTK_SIZE_REQUEST (path_bar->up_slider_button),
+				   &child_requisition, NULL);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (path_bar->down_slider_button),
+				   &child_requisition, NULL);
 
 	border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
         requisition->width += border_width * 2;
@@ -573,12 +576,14 @@ nautilus_path_bar_size_allocate (GtkWidget     *widget,
 		width = 0;
 	}
 
-	gtk_widget_get_child_requisition (BUTTON_DATA (path_bar->button_list->data)->button, &child_requisition);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (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_size_request_get_size (GTK_SIZE_REQUEST (child),
+					   &child_requisition, NULL);
                 width += child_requisition.width + path_bar->spacing;
 
 		if (list == path_bar->fake_root) {
@@ -610,12 +615,14 @@ nautilus_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_size_request_get_size (GTK_SIZE_REQUEST (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_size_request_get_size (GTK_SIZE_REQUEST (child),
+						   &child_requisition, NULL);
 
 	  		if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width) {
 	    			reached_end = TRUE;
@@ -634,7 +641,8 @@ nautilus_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_size_request_get_size (GTK_SIZE_REQUEST (child),
+						   &child_requisition, NULL);
 
 	  		if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width) {
 	      			reached_end = TRUE;
@@ -668,7 +676,8 @@ nautilus_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_size_request_get_size (GTK_SIZE_REQUEST (child),
+					   &child_requisition, NULL);
 
 		gtk_widget_get_allocation (widget, &widget_allocation);
 
diff --git a/src/nautilus-side-pane.c b/src/nautilus-side-pane.c
index d8e0f6a..fe67f0c 100644
--- a/src/nautilus-side-pane.c
+++ b/src/nautilus-side-pane.c
@@ -140,7 +140,8 @@ nautilus_side_pane_size_allocate (GtkWidget *widget,
 	frame = pane->details->title_frame;
 	hbox = pane->details->title_hbox;
 
-	gtk_widget_get_child_requisition (hbox, &child_requisition);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (hbox),
+				   &child_requisition, NULL);
 	width = child_requisition.width;
 
 	gtk_widget_get_allocation (frame, &frame_allocation);
@@ -242,7 +243,8 @@ select_button_press_callback (GtkWidget *widget,
                 gtk_widget_get_allocation (widget, &allocation);
                 width = allocation.width;
                 gtk_widget_set_size_request (side_pane->details->menu, -1, -1);
-                gtk_widget_size_request (side_pane->details->menu, &requisition);
+                gtk_size_request_get_size (GTK_SIZE_REQUEST (side_pane->details->menu),
+					   &requisition, NULL);
                 gtk_widget_set_size_request (side_pane->details->menu,
                                              MAX (width, requisition.width), -1);
 
diff --git a/src/nautilus-spatial-window.c b/src/nautilus-spatial-window.c
index c6dd9c6..35eac2d 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -607,8 +607,10 @@ menu_popup_pos (GtkMenu   *menu,
 
 	widget = user_data;
 
-	gtk_widget_size_request (GTK_WIDGET (menu), &menu_requisition);
-	gtk_widget_size_request (widget, &button_requisition);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
+				   &menu_requisition, NULL);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
+				   &button_requisition, NULL);
 	gtk_widget_get_allocation (widget, &allocation);
 
 	gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
diff --git a/src/nautilus-zoom-control.c b/src/nautilus-zoom-control.c
index 2907cd7..4c69bef 100644
--- a/src/nautilus-zoom-control.c
+++ b/src/nautilus-zoom-control.c
@@ -149,8 +149,10 @@ menu_position_under_widget (GtkMenu   *menu,
 	container = gtk_widget_get_ancestor (widget, GTK_TYPE_CONTAINER);
 	g_assert (container != NULL);
 
-	gtk_widget_size_request (widget, &req);
-	gtk_widget_size_request (GTK_WIDGET (menu), &menu_req);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (menu),
+				   &menu_req, NULL);
+	gtk_size_request_get_size (GTK_SIZE_REQUEST (widget),
+				   &req, NULL);
 	gtk_widget_get_allocation (widget, &allocation);
 
 	screen = gtk_widget_get_screen (GTK_WIDGET (menu));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]