From c4cad41ce3e89915b06892064e0a380d40faf257 Mon Sep 17 00:00:00 2001
From: Simon Schampijer <simon@laptop.org>
Date: Mon, 10 Dec 2012 14:22:57 -0300
Subject: [PATCH toolkit 2/2] TrayIcon: get the black background and outline
for palette popup - SL #4089
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
Do the same as in ToolButton, update do_draw method to do the drawing
in the code.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
---
src/sugar3/graphics/tray.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/sugar3/graphics/tray.py b/src/sugar3/graphics/tray.py
index 9d12883..c0e5679 100644
a
|
b
|
class _IconWidget(Gtk.EventBox): |
432 | 432 | |
433 | 433 | def do_draw(self, cr): |
434 | 434 | palette = self.get_parent().palette |
| 435 | |
| 436 | if palette and palette.is_up(): |
| 437 | allocation = self.get_allocation() |
| 438 | # draw a black background, has been done by the engine before |
| 439 | cr.set_source_rgb(0, 0, 0) |
| 440 | cr.rectangle(0, 0, allocation.width, allocation.height) |
| 441 | cr.paint() |
| 442 | |
| 443 | Gtk.EventBox.do_draw(self, cr) |
| 444 | |
435 | 445 | if palette and palette.is_up(): |
436 | 446 | invoker = palette.props.invoker |
437 | 447 | invoker.draw_rectangle(cr, palette) |
438 | 448 | |
439 | | Gtk.EventBox.do_draw(self, cr) |
| 449 | return False |
440 | 450 | |
441 | 451 | def get_icon(self): |
442 | 452 | return self._icon |