[gimp/soc-2010-cage-2] app: some cleanup in gimp_paned_box_position_drop_indicator()



commit 2fca0ee399190af9dd8ac5d5be42f36d7c2cd4c2
Author: Michael Natterer <mitch gimp org>
Date:   Sat Dec 18 23:28:20 2010 +0100

    app: some cleanup in gimp_paned_box_position_drop_indicator()

 app/widgets/gimppanedbox.c |   39 +++++++++++++++++++--------------------
 1 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/app/widgets/gimppanedbox.c b/app/widgets/gimppanedbox.c
index 6355fa9..f183a94 100644
--- a/app/widgets/gimppanedbox.c
+++ b/app/widgets/gimppanedbox.c
@@ -216,29 +216,27 @@ gimp_paned_box_position_drop_indicator (GimpPanedBox *paned_box,
   /* Create or move the GdkWindow in place */
   if (! paned_box->p->dnd_window)
     {
-      GdkColor      *color;
-      GtkWidget     *paned_box_w = NULL;
-      GtkAllocation  allocation  = { 0, };
-      GdkWindowAttr  attributes = { 0, };
-
-      paned_box_w = GTK_WIDGET (paned_box);
-      gtk_widget_get_allocation (paned_box_w, &allocation);
-
-      attributes.x                 = x;
-      attributes.y                 = y;
-      attributes.width             = width;
-      attributes.height            = height;
-      attributes.window_type       = GDK_WINDOW_CHILD;
-      attributes.wclass            = GDK_INPUT_OUTPUT;
-      attributes.event_mask        = gtk_widget_get_events (paned_box_w);
-
-      paned_box->p->dnd_window = gdk_window_new (gtk_widget_get_window (paned_box_w),
+      GtkStyle      *style = gtk_widget_get_style (widget);
+      GtkAllocation  allocation;
+      GdkWindowAttr  attributes;
+
+      gtk_widget_get_allocation (widget, &allocation);
+
+      attributes.x           = x;
+      attributes.y           = y;
+      attributes.width       = width;
+      attributes.height      = height;
+      attributes.window_type = GDK_WINDOW_CHILD;
+      attributes.wclass      = GDK_INPUT_OUTPUT;
+      attributes.event_mask  = gtk_widget_get_events (widget);
+
+      paned_box->p->dnd_window = gdk_window_new (gtk_widget_get_window (widget),
                                                  &attributes,
                                                  GDK_WA_X | GDK_WA_Y);
-      gdk_window_set_user_data (paned_box->p->dnd_window, paned_box_w);
+      gdk_window_set_user_data (paned_box->p->dnd_window, widget);
 
-      color = gtk_widget_get_style (widget)->bg + GTK_STATE_SELECTED;
-      gdk_window_set_background (paned_box->p->dnd_window, color);
+      gdk_window_set_background (paned_box->p->dnd_window,
+                                 &style->bg[GTK_STATE_SELECTED]);
     }
   else
     {
@@ -246,6 +244,7 @@ gimp_paned_box_position_drop_indicator (GimpPanedBox *paned_box,
                               x, y,
                               width, height);
     }
+
   gdk_window_show (paned_box->p->dnd_window);
 }
 



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