From dae382e6eb54fa4f8d9bd6e608a5c067df0ff297 Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Tue, 11 Dec 2012 12:52:22 +0000 Subject: Draw the color button in the correct order - SL #4303 Same issue in toolkit was fixed in commit 8a9d10cd . Signed-off-by: Manuel QuiƱones --- diff --git a/widgets.py b/widgets.py index bf43cf8..e2067ea 100644 --- a/widgets.py +++ b/widgets.py @@ -405,17 +405,19 @@ class ButtonStrokeColor(Gtk.ToolItem): title = GObject.property(type=str, getter=get_title, setter=set_title) - def do_expose_event(self, event): + def do_draw(self, cr): child = self.get_child() - allocation = self.get_allocation() + if self._palette and self._palette.is_up(): + allocation = self.get_allocation() + # draw a black background, has been done by the engine before + cr.set_source_rgb(0, 0, 0) + cr.rectangle(0, 0, allocation.width, allocation.height) + cr.paint() + + Gtk.ToolItem.do_draw(self, cr) + if self._palette and self._palette.is_up(): invoker = self._palette.props.invoker - invoker.draw_rectangle(event, self._palette) - elif child.state == Gtk.StateType.PRELIGHT: - child.style.paint_box(event.window, Gtk.StateType.PRELIGHT, - Gtk.ShadowType.NONE, event.area, - child, 'toolbutton-prelight', - allocation.x, allocation.y, - allocation.width, allocation.height) - - Gtk.ToolButton.do_expose_event(self, event) + invoker.draw_rectangle(cr, self._palette) + + return False -- cgit v0.9.1