diff options
-rw-r--r-- | widgets.py | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -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 |