[gnome-panel] panel: Minor cleanup



commit 0093d7db9f3d42e81994789c9b16b8ff72014054
Author: Peter Hurley <peter hurleysoftware com>
Date:   Thu Feb 2 10:50:25 2012 +0100

    panel: Minor cleanup
    
    Move some variable initializations around.

 gnome-panel/panel-applet-frame.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index f2cfc38..a26a254 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -234,6 +234,9 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 	GtkAllocation     old_allocation;
 	GtkAllocation     widget_allocation;
 
+	frame = PANEL_APPLET_FRAME (widget);
+	bin = GTK_BIN (widget);
+
 	gtk_widget_get_allocation (widget, &widget_allocation);
 
 	old_allocation.x      = widget_allocation.x;
@@ -241,9 +244,6 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 	old_allocation.width  = widget_allocation.width;
 	old_allocation.height = widget_allocation.height;
 
-	frame = PANEL_APPLET_FRAME (widget);
-	bin = GTK_BIN (widget);
-
 	if (!frame->priv->has_handle) {
 		GTK_WIDGET_CLASS (panel_applet_frame_parent_class)->size_allocate (widget,
 										   allocation);
@@ -253,8 +253,6 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 		return;
 	}
 
-	window = gtk_widget_get_window (widget);
-	child = gtk_bin_get_child (bin);
 	gtk_widget_set_allocation (widget, allocation);
 
 	frame->priv->handle_rect.x = 0;
@@ -297,6 +295,8 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 	new_allocation.width  = MAX (1, new_allocation.width);
 	new_allocation.height = MAX (1, new_allocation.height);
 
+	window = gtk_widget_get_window (widget);
+
 	/* If the child allocation changed, that means that the frame is drawn
 	 * in a new place, so we must redraw the entire widget.
 	 */
@@ -318,6 +318,7 @@ panel_applet_frame_size_allocate (GtkWidget     *widget,
 			MAX (allocation->height - border_width * 2, 0));
 	}
 
+	child = gtk_bin_get_child (bin);
 	if (child && gtk_widget_get_visible (child))
 		gtk_widget_size_allocate (child, &new_allocation);
   



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