[gtk+/wip/cosimoc/scrolledwin-gadget: 27/29] viewport: don't render a background over the bin window



commit 8f3e0c3d51304f69fb21dfa6d919033ba8ee60e2
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Dec 28 12:21:27 2015 -0800

    viewport: don't render a background over the bin window
    
    GtkViewport currently tries to draw a background over the bin window.
    The feature is a bit broken at the moment, as it does not take into
    account padding that might have been set on the GtkViewport, but in
    general it does not seem very useful, and goes somewhat against the CSS
    box model where every widget/gadget is responsible to draw its own
    background. For a fix, we could either have the viewport gain a "bin"
    gadget, or we could stop drawing the background.
    
    As it isn't clear that there are any users of this feature, stop drawing
    the background; a client can achieve the same effect by drawing the
    background on the widget inside the viewport itself.

 gtk/gtkviewport.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 1fe575f..7a67fb8 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -321,17 +321,6 @@ draw_bin (cairo_t *cr,
          gpointer user_data)
 {
   GtkWidget *widget = GTK_WIDGET (user_data);
-  GtkViewport *viewport = GTK_VIEWPORT (widget);
-  GtkViewportPrivate *priv = viewport->priv;
-  GtkStyleContext *context;
-  int x, y;
-
-  context = gtk_widget_get_style_context (widget);
-
-  gdk_window_get_position (priv->bin_window, &x, &y);
-  gtk_render_background (context, cr, x, y,
-                        gdk_window_get_width (priv->bin_window),
-                        gdk_window_get_height (priv->bin_window));
   GTK_WIDGET_CLASS (gtk_viewport_parent_class)->draw (widget, cr);
 }
 


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