]> Pileus Git - ~andy/gtk/commitdiff
Fix shadow painting if the scrollbars-within-bevel style property is set
authorBenjamin Berg <benjamin@sipsolutions.net>
Fri, 8 Jun 2007 12:32:02 +0000 (12:32 +0000)
committerBenjamin Berg <bberg@src.gnome.org>
Fri, 8 Jun 2007 12:32:02 +0000 (12:32 +0000)
2007-06-08  Benjamin Berg  <benjamin@sipsolutions.net>

* gtk/gtkscrolledwindow.c: (gtk_scrolled_window_paint):
Fix shadow painting if the scrollbars-within-bevel style property is
set and border_width is nozero. (#445054)

svn path=/trunk/; revision=18082

ChangeLog
gtk/gtkscrolledwindow.c

index 1999228e0031aae3c554d774bc06a6cb39709110..c07b176f5b6fe6bfdb947af96d82104a7b524d08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-08  Benjamin Berg  <benjamin@sipsolutions.net>
+
+       * gtk/gtkscrolledwindow.c: (gtk_scrolled_window_paint):
+       Fix shadow painting if the scrollbars-within-bevel style property is
+       set and border_width is nozero. (#445054)
+
 2007-06-08  Matthias Clasen  <mclasen@redhat.com>
 
        Make it possible for theme engines to support symbolic 
index 584a2bd99dae009533758c4ec1707ef6337b2c2e..a82bf3865002b47c18e0e0c2db5046282c4a2b98 100644 (file)
@@ -958,38 +958,28 @@ gtk_scrolled_window_paint (GtkWidget    *widget,
     {
       GtkAllocation relative_allocation;
       gboolean scrollbars_within_bevel;
-      gint scrollbar_spacing;
 
-      gtk_scrolled_window_relative_allocation (widget, &relative_allocation);
       gtk_widget_style_get (widget, "scrollbars-within-bevel", &scrollbars_within_bevel, NULL);
-      scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window);
       
-      relative_allocation.x -= widget->style->xthickness;
-      relative_allocation.y -= widget->style->ythickness;
-      relative_allocation.width += 2 * widget->style->xthickness;
-      relative_allocation.height += 2 * widget->style->ythickness;
-
-      if (scrollbars_within_bevel)
+      if (!scrollbars_within_bevel)
         {
-          if (GTK_WIDGET_VISIBLE (scrolled_window->hscrollbar))
-            {
-              gint dy = scrolled_window->hscrollbar->allocation.height + scrollbar_spacing;
-              relative_allocation.height += dy;
+          gtk_scrolled_window_relative_allocation (widget, &relative_allocation);
 
-              if (relative_allocation.y)
-                relative_allocation.y -= dy;
-            }
-
-          if (GTK_WIDGET_VISIBLE (scrolled_window->vscrollbar))
-            {
-              gint dx = scrolled_window->vscrollbar->allocation.width + scrollbar_spacing;
-              relative_allocation.width += dx;
+          relative_allocation.x -= widget->style->xthickness;
+          relative_allocation.y -= widget->style->ythickness;
+          relative_allocation.width += 2 * widget->style->xthickness;
+          relative_allocation.height += 2 * widget->style->ythickness;
+        }
+      else
+        {
+          GtkContainer *container = GTK_CONTAINER (widget);
 
-              if (relative_allocation.x)
-                relative_allocation.x -= dx;
-            }
+          relative_allocation.x = container->border_width;
+          relative_allocation.y = container->border_width;
+          relative_allocation.width = widget->allocation.width - 2 * container->border_width;
+          relative_allocation.height = widget->allocation.height - 2 * container->border_width;
         }
-      
+
       gtk_paint_shadow (widget->style, widget->window,
                        GTK_STATE_NORMAL, scrolled_window->shadow_type,
                        area, widget, "scrolled_window",