From e49f6211108b88c086fbf98f83d3442f1c666b2f Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Mon, 10 Dec 2012 14:22:57 -0300 Subject: [PATCH] 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 Do the same as in ToolButton, update do_draw method to do the drawing in the code. Signed-off-by: Simon Schampijer Acked-by: Manuel QuiƱones --- 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 9d128836..c0e56794 100644 --- a/src/sugar3/graphics/tray.py +++ b/src/sugar3/graphics/tray.py @@ -432,11 +432,21 @@ class _IconWidget(Gtk.EventBox): def do_draw(self, cr): palette = self.get_parent().palette + + if palette and palette.is_up(): + 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.EventBox.do_draw(self, cr) + if palette and palette.is_up(): invoker = palette.props.invoker invoker.draw_rectangle(cr, palette) - Gtk.EventBox.do_draw(self, cr) + return False def get_icon(self): return self._icon