diff options
Diffstat (limited to 'sugar/graphics/toolbutton.py')
-rw-r--r-- | sugar/graphics/toolbutton.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sugar/graphics/toolbutton.py b/sugar/graphics/toolbutton.py index 08bc1f3..236d7ec 100644 --- a/sugar/graphics/toolbutton.py +++ b/sugar/graphics/toolbutton.py @@ -106,20 +106,21 @@ class ToolButton(gtk.ToolButton): self._palette = palette self._palette.props.invoker = ToolInvoker(self) - palette = gobject.property(type=object, setter=set_palette, getter=get_palette) + palette = gobject.property( + type=object, setter=set_palette, getter=get_palette) def do_expose_event(self, event): + child = self.get_child() + allocation = self.get_allocation() if self._palette and self._palette.is_up(): invoker = self._palette.props.invoker invoker.draw_rectangle(event, self._palette) - elif self.child.state == gtk.STATE_PRELIGHT: - self.child.style.paint_box(event.window, gtk.STATE_PRELIGHT, - gtk.SHADOW_NONE, event.area, - self.child, "toolbutton-prelight", - self.allocation.x, - self.allocation.y, - self.allocation.width, - self.allocation.height) + elif child.state == gtk.STATE_PRELIGHT: + child.style.paint_box(event.window, gtk.STATE_PRELIGHT, + gtk.SHADOW_NONE, event.area, + child, "toolbutton-prelight", + allocation.x, allocation.y, + allocation.width, allocation.height) gtk.ToolButton.do_expose_event(self, event) |