From 12489d4d349cdfba3ef45e30adf81f81794e13a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
Date: Tue, 11 Dec 2012 01:19:12 -0300
Subject: [PATCH toolkit] ColorToolButton: do the drawing in the correct order
- SL #4303
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
1. if the palette is up, draw the black background
2. draw the button itself
3. if the palette is up, draw the grey outline
Exactly as the ToolButton does.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
---
src/sugar3/graphics/colorbutton.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/sugar3/graphics/colorbutton.py b/src/sugar3/graphics/colorbutton.py
index 065a55e..3f205ff 100644
a
|
b
|
class ColorToolButton(Gtk.ToolItem): |
541 | 541 | |
542 | 542 | def do_draw(self, cr): |
543 | 543 | child = self.get_child() |
544 | | allocation = self.get_allocation() |
545 | 544 | if self._palette and self._palette.is_up(): |
546 | | invoker = self._palette.props.invoker |
547 | | invoker.draw_rectangle(cr, self._palette) |
548 | | |
549 | 545 | allocation = self.get_allocation() |
550 | 546 | # draw a black background, has been done by the engine before |
551 | 547 | cr.set_source_rgb(0, 0, 0) |
552 | 548 | cr.rectangle(0, 0, allocation.width, allocation.height) |
553 | 549 | cr.paint() |
554 | 550 | |
555 | | Gtk.ToolButton.do_draw(self, cr) |
| 551 | Gtk.ToolItem.do_draw(self, cr) |
| 552 | |
| 553 | if self._palette and self._palette.is_up(): |
| 554 | invoker = self._palette.props.invoker |
| 555 | invoker.draw_rectangle(cr, self._palette) |
| 556 | |
| 557 | return False |
556 | 558 | |
557 | 559 | def __notify_change(self, widget, pspec): |
558 | 560 | self.notify(pspec.name) |