diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-15 19:18:58 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-08-15 19:18:58 (GMT) |
commit | 4f1986e8a4e3ce567595404a9d425a58f16f4f1c (patch) | |
tree | e28af7fda24e19473fd2979646ceedfca8424b83 /sugar/graphics/palette.py | |
parent | 43fb1627a7ce9a5e05230699cda7448c44f5c689 (diff) |
Let the invoker deal with popup/popdown redraw.
Diffstat (limited to 'sugar/graphics/palette.py')
-rw-r--r-- | sugar/graphics/palette.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sugar/graphics/palette.py b/sugar/graphics/palette.py index 368a0f6..2d6b35b 100644 --- a/sugar/graphics/palette.py +++ b/sugar/graphics/palette.py @@ -398,6 +398,9 @@ class Palette(gtk.Window): self.menu.set_active(True) self.show() + if self._invoker: + self._invoker.notify_popup() + self._up = True _palette_observer.emit('popup', self) self.emit('popup') @@ -406,9 +409,13 @@ class Palette(gtk.Window): if not self._palette_popup_sid is None: _palette_observer.disconnect(self._palette_popup_sid) self._palette_popup_sid = None + self.menu.set_active(False) self.hide() + if self._invoker: + self._invoker.notify_popdown() + self._up = False self.emit('popdown') @@ -543,6 +550,12 @@ class Invoker(gobject.GObject): height = gtk.gdk.screen_height() return gtk.gdk.Rectangle(0, 0, width, height) + def notify_popup(self): + pass + + def notify_popdown(self): + pass + class WidgetInvoker(Invoker): def __init__(self, widget): Invoker.__init__(self) @@ -602,6 +615,12 @@ class WidgetInvoker(Invoker): def get_toplevel(self): return self._widget.get_toplevel() + def notify_popup(self): + self._widget.queue_draw() + + def notify_popdown(self): + self._widget.queue_draw() + class CanvasInvoker(Invoker): def __init__(self, item): Invoker.__init__(self) |