[Sugar-devel] [PATCH] Draw border for palette all the time SL #3383

Simon Schampijer simon at schampijer.de
Wed Apr 18 16:46:00 EDT 2012


gtk_render_frame_gap [1] does expect an initial and an end
coordinate for the gap. paint_box_gap [2] which we used
before expected a starting position of the gap and the width
of the gap as parameter.

The patch does calculate the end coordinate parameter for
the gap from the initial coordinate and the width of the
gap.

Signed-off-by: Simon Schampijer <simon at laptop.org>

[1] http://developer.gnome.org/gtk3/3.0/GtkStyleContext.html#gtk-render-frame-gap
[2] http://developer.gnome.org/gtk/2.24/GtkStyle.html#gtk-paint-box-gap
---
 src/sugar3/graphics/palettewindow.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
index 8bd2bed..449f550 100644
--- a/src/sugar3/graphics/palettewindow.py
+++ b/src/sugar3/graphics/palettewindow.py
@@ -331,7 +331,7 @@ class _PaletteWindowWidget(Gtk.Window):
         context.add_class('toolitem')
         if gap:
             Gtk.render_frame_gap(context, cr, 0, 0, allocation.width, allocation.height,
-                                 gap[0], gap[1], gap[2])
+                                 gap[0], gap[1], gap[1] + gap[2])
         else:
             Gtk.render_frame(context, cr, 0, 0, allocation.width, allocation.height)
         return False
@@ -1025,7 +1025,7 @@ class WidgetInvoker(Invoker):
             Gtk.render_frame_gap(context, cr, 0, 0,
                                  allocation.width,
                                  allocation.height,
-                                 gap[0], gap[1], gap[2])
+                                 gap[0], gap[1], gap[1] + gap[2])
 
     def __enter_notify_event_cb(self, widget, event):
         self.notify_mouse_enter()
-- 
1.7.7.6



More information about the Sugar-devel mailing list