Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel QuiƱones <manuq@laptop.org>2012-08-29 12:11:12 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-08-29 12:11:12 (GMT)
commit5bdd4f25da8c9d253ddd70d33fb14b646f31fdd2 (patch)
treeca0c2c05ef57b2ccdc3de3c45b96fe8e7312a213
parent5d7374ca5388dddd83bac6abc808ddebda06c06a (diff)
Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton
Draw a black background in the buttons when the palette is up, as commit 01a06943 did with the ToolButton.
-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, 18 insertions, 24 deletions
diff --git a/src/sugar3/graphics/colorbutton.py b/src/sugar3/graphics/colorbutton.py
index c46293f..25c567d 100644
--- a/src/sugar3/graphics/colorbutton.py
+++ b/src/sugar3/graphics/colorbutton.py
@@ -522,14 +522,12 @@ class ColorToolButton(Gtk.ToolItem):
if self._palette and self._palette.is_up():
invoker = self._palette.props.invoker
invoker.draw_rectangle(cr, self._palette)
- elif child.state == Gtk.StateType.PRELIGHT:
- # FIXME
- pass
- # 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)
+
+ 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.ToolButton.do_draw(self, cr)
diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
index 5ff5532..006d167 100644
--- a/src/sugar3/graphics/radiotoolbutton.py
+++ b/src/sugar3/graphics/radiotoolbutton.py
@@ -172,13 +172,11 @@ class RadioToolButton(Gtk.RadioToolButton):
if self.palette and self.palette.is_up():
invoker = self.palette.props.invoker
invoker.draw_rectangle(cr, self.palette)
- elif child.get_state() == Gtk.StateType.PRELIGHT:
- # FIXME
- pass
- # 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)
+
+ 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.RadioToolButton.do_draw(self, cr)
diff --git a/src/sugar3/graphics/toggletoolbutton.py b/src/sugar3/graphics/toggletoolbutton.py
index f4ff339..56d461d 100644
--- a/src/sugar3/graphics/toggletoolbutton.py
+++ b/src/sugar3/graphics/toggletoolbutton.py
@@ -79,14 +79,12 @@ class ToggleToolButton(Gtk.ToggleToolButton):
if self.palette and self.palette.is_up():
invoker = self.palette.props.invoker
invoker.draw_rectangle(cr, self.palette)
- elif child.state == Gtk.StateType.PRELIGHT:
- # FIXME
- pass
- # 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)
+
+ 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.ToggleToolButton.do_draw(self, cr)