[gtk+/gtk-3-10] treeview: Don't draw a background for the bin window



commit 3b25efffce83a95f322258a7c01988fae55ec583
Author: Benjamin Otte <otte redhat com>
Date:   Wed Dec 4 10:37:31 2013 +0100

    treeview: Don't draw a background for the bin window
    
    The bin window's background would have to be drawn in the bin window's
    size and inside the pixel cache draw function to not cause transparency
    issues.
    
    But because it's unnecessary as the view window draws the same
    background, we just skip it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709027

 gtk/gtktreeview.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index e38dab0..a91d476 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2221,7 +2221,6 @@ gtk_tree_view_ensure_background (GtkTreeView *tree_view)
 
   context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
 
-  gtk_style_context_set_background (context, tree_view->priv->bin_window);
   gtk_style_context_set_background (context, gtk_widget_get_window (GTK_WIDGET (tree_view)));
   gtk_style_context_set_background (context, tree_view->priv->header_window);
 }
@@ -5457,10 +5456,6 @@ gtk_tree_view_draw (GtkWidget *widget,
   GtkStyleContext *context;
 
   context = gtk_widget_get_style_context (widget);
-  gtk_render_background (context, cr,
-                         0, 0,
-                         gtk_widget_get_allocated_width (widget),
-                         gtk_widget_get_allocated_height (widget));
 
   if (gtk_cairo_should_draw_window (cr, tree_view->priv->bin_window))
     {
@@ -5481,6 +5476,13 @@ gtk_tree_view_draw (GtkWidget *widget,
                             &view_rect, &canvas_rect,
                             draw_bin, widget);
     }
+  else
+    {
+      gtk_render_background (context, cr,
+                             0, 0,
+                             gtk_widget_get_allocated_width (widget),
+                             gtk_widget_get_allocated_height (widget));
+    }
 
   gtk_style_context_save (context);
   gtk_style_context_remove_class (context, GTK_STYLE_CLASS_VIEW);


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