Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'widgets.py')
-rw-r--r--widgets.py24
1 files changed, 13 insertions, 11 deletions
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