Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/graphics/toggletoolbutton.py
diff options
context:
space:
mode:
Diffstat (limited to 'sugar/graphics/toggletoolbutton.py')
-rw-r--r--sugar/graphics/toggletoolbutton.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/sugar/graphics/toggletoolbutton.py b/sugar/graphics/toggletoolbutton.py
index 3d05cc0..4c59f80 100644
--- a/sugar/graphics/toggletoolbutton.py
+++ b/sugar/graphics/toggletoolbutton.py
@@ -46,17 +46,18 @@ class ToggleToolButton(gtk.ToggleToolButton):
self.set_palette(Palette(text))
def do_expose_event(self, event):
+ allocation = self.get_allocation()
+ child = self.get_child()
+
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.ToggleToolButton.do_expose_event(self, event)