Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorManuel QuiƱones <manuq@laptop.org>2012-08-23 21:13:47 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-08-23 21:13:47 (GMT)
commit00761f3d01305bb419e0a7a56167879c4b3eb093 (patch)
treedf72677aefd86603c693b00932755cbb11866efb /src
parent030ab202c8314251314a5812c7ff1ebd21c8d938 (diff)
Revert "Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton"
This reverts commit 1e6cba84742432a667a8d4a0bc8bd264da2b409c.
Diffstat (limited to 'src')
-rw-r--r--src/sugar3/graphics/colorbutton.py14
-rw-r--r--src/sugar3/graphics/radiotoolbutton.py14
-rw-r--r--src/sugar3/graphics/toggletoolbutton.py14
3 files changed, 30 insertions, 12 deletions
diff --git a/src/sugar3/graphics/colorbutton.py b/src/sugar3/graphics/colorbutton.py
index 0783481..95d023a 100644
--- a/src/sugar3/graphics/colorbutton.py
+++ b/src/sugar3/graphics/colorbutton.py
@@ -523,14 +523,20 @@ class ColorToolButton(Gtk.ToolItem):
title = GObject.property(type=str, getter=get_title, setter=set_title)
- def do_draw(self, cr):
+ 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(cr, self._palette)
-
- Gtk.ToolButton.do_draw(self, cr)
+ 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)
def __notify_change(self, widget, pspec):
self.notify(pspec.name)
diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
index d843b1f..8fd01f7 100644
--- a/src/sugar3/graphics/radiotoolbutton.py
+++ b/src/sugar3/graphics/radiotoolbutton.py
@@ -165,12 +165,18 @@ class RadioToolButton(Gtk.RadioToolButton):
palette_invoker = GObject.property(
type=object, setter=set_palette_invoker, getter=get_palette_invoker)
- def do_draw(self, cr):
+ 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(cr, self.palette)
-
- Gtk.RadioToolButton.do_draw(self, cr)
+ 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.RadioToolButton.do_expose_event(self, event)
diff --git a/src/sugar3/graphics/toggletoolbutton.py b/src/sugar3/graphics/toggletoolbutton.py
index 63f4ed6..c865332 100644
--- a/src/sugar3/graphics/toggletoolbutton.py
+++ b/src/sugar3/graphics/toggletoolbutton.py
@@ -113,14 +113,20 @@ class ToggleToolButton(Gtk.ToggleToolButton):
accelerator = GObject.property(type=str, setter=set_accelerator,
getter=get_accelerator)
- def do_draw(self, cr):
+ 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(cr, self.palette)
-
- Gtk.ToggleToolButton.do_draw(self, cr)
+ 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.ToggleToolButton.do_expose_event(self, event)
palette = property(get_palette, set_palette)