[nautilus] [src] use gtk_widget_get_preferred_size()



commit c47d18f566fa9518ca7750922da7da66d3211f3e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 29 14:24:53 2010 +0200

    [src] use gtk_widget_get_preferred_size()

 src/nautilus-pathbar.c        |   36 ++++++++++++++++++------------------
 src/nautilus-side-pane.c      |    8 ++++----
 src/nautilus-spatial-window.c |    8 ++++----
 src/nautilus-zoom-control.c   |    8 ++++----
 4 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 8ef14c8..6a05f6e 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -474,8 +474,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_size_request_get_size (GTK_SIZE_REQUEST (button_data->button),
-							     &child_requisition, NULL);
+		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);
         }
@@ -489,10 +489,10 @@ nautilus_path_bar_size_request (GtkWidget      *widget,
 		requisition->width += (path_bar->spacing + path_bar->slider_width) * 2;
 	}
 
-	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);
+	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;
@@ -573,14 +573,14 @@ nautilus_path_bar_size_allocate (GtkWidget     *widget,
 		width = 0;
 	}
 
-	gtk_size_request_get_size (GTK_SIZE_REQUEST (BUTTON_DATA (path_bar->button_list->data)->button),
-				   &child_requisition, NULL);
+	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_size_request_get_size (GTK_SIZE_REQUEST (child),
-					   &child_requisition, NULL);
+		gtk_widget_get_preferred_size (child,
+					       &child_requisition, NULL);
                 width += child_requisition.width + path_bar->spacing;
 
 		if (list == path_bar->fake_root) {
@@ -612,14 +612,14 @@ nautilus_path_bar_size_allocate (GtkWidget     *widget,
        		* button, then count backwards.
        		*/
       		/* Count down the path chain towards the end. */
-		gtk_size_request_get_size (GTK_SIZE_REQUEST (BUTTON_DATA (first_button->data)->button),
-					   &child_requisition, NULL);
+		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_size_request_get_size (GTK_SIZE_REQUEST (child),
-						   &child_requisition, NULL);
+			gtk_widget_get_preferred_size (child,
+						       &child_requisition, NULL);
 
 	  		if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width) {
 	    			reached_end = TRUE;
@@ -638,8 +638,8 @@ nautilus_path_bar_size_allocate (GtkWidget     *widget,
 
                 while (first_button->next && ! reached_end) {
 	  		child = BUTTON_DATA (first_button->next->data)->button;
-			gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
-						   &child_requisition, NULL);
+			gtk_widget_get_preferred_size (child,
+						       &child_requisition, NULL);
 
 	  		if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width) {
 	      			reached_end = TRUE;
@@ -673,8 +673,8 @@ nautilus_path_bar_size_allocate (GtkWidget     *widget,
 
         for (list = first_button; list; list = list->prev) {
                 child = BUTTON_DATA (list->data)->button;
-		gtk_size_request_get_size (GTK_SIZE_REQUEST (child),
-					   &child_requisition, NULL);
+		gtk_widget_get_preferred_size (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 2988982..41b32fa 100644
--- a/src/nautilus-side-pane.c
+++ b/src/nautilus-side-pane.c
@@ -140,8 +140,8 @@ nautilus_side_pane_size_allocate (GtkWidget *widget,
 	frame = pane->details->title_frame;
 	hbox = pane->details->title_hbox;
 
-	gtk_size_request_get_size (GTK_SIZE_REQUEST (hbox),
-				   &child_requisition, NULL);
+	gtk_widget_get_preferred_size (hbox,
+				       &child_requisition, NULL);
 	width = child_requisition.width;
 
 	gtk_widget_get_allocation (frame, &frame_allocation);
@@ -243,8 +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_size_request_get_size (GTK_SIZE_REQUEST (side_pane->details->menu),
-					   &requisition, NULL);
+                gtk_widget_get_preferred_size (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 67c4a89..3efdb38 100644
--- a/src/nautilus-spatial-window.c
+++ b/src/nautilus-spatial-window.c
@@ -607,10 +607,10 @@ menu_popup_pos (GtkMenu   *menu,
 
 	widget = user_data;
 
-	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_preferred_size (GTK_WIDGET (menu),
+				       &menu_requisition, NULL);
+	gtk_widget_get_preferred_size (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 9457b58..85f81ba 100644
--- a/src/nautilus-zoom-control.c
+++ b/src/nautilus-zoom-control.c
@@ -148,10 +148,10 @@ menu_position_under_widget (GtkMenu   *menu,
 	container = gtk_widget_get_ancestor (widget, GTK_TYPE_CONTAINER);
 	g_assert (container != NULL);
 
-	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_preferred_size (GTK_WIDGET (menu),
+				       &menu_req, NULL);
+	gtk_widget_get_preferred_size (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]