]> Pileus Git - ~andy/gtk/commitdiff
treeview: set "dnd" style class when drawing drag and drop indicators
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 14 Feb 2012 03:19:53 +0000 (22:19 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 14 Feb 2012 03:19:53 +0000 (22:19 -0500)
This is useful to theme the rings that appear around rows on drag and
drop.

gtk/gtktreeview.c

index 251717f5ac39ab0e0d9a8e273d723a26761a4f18..c8d08950713d985ab2b3a48a602e9c395e408dcc 100644 (file)
@@ -5176,6 +5176,9 @@ gtk_tree_view_bin_draw (GtkWidget      *widget,
          GtkRBTree *tree = NULL;
          GtkRBNode *node = NULL;
 
+          gtk_style_context_save (context);
+          gtk_style_context_add_class (context, GTK_STYLE_CLASS_DND);
+
           switch (tree_view->priv->drag_dest_pos)
             {
             case GTK_TREE_VIEW_DROP_BEFORE:
@@ -5213,6 +5216,8 @@ gtk_tree_view_bin_draw (GtkWidget      *widget,
                                        rtl ? 0 : bin_window_width,
                                        highlight_y);
             }
+
+          gtk_style_context_restore (context);
         }
 
       /* draw the big row-spanning focus rectangle, if needed */