Dont pop down the palette when a submenu opens

This commit is contained in:
Tomeu Vizoso 2008-12-07 16:50:25 +01:00
parent 3f1509cd22
commit 054aaf8590

View File

@ -547,6 +547,7 @@ class Palette(gtk.Window):
self.move(position.x, position.y)
def popup(self, immediate=False):
logging.debug('Palette.popup immediate %r' % immediate)
if self._invoker is not None:
self._update_full_request()
self._alignment = self._invoker.get_alignment(self._full_request)
@ -563,6 +564,7 @@ class Palette(gtk.Window):
self._secondary_anim.start()
def popdown(self, immediate=False):
logging.debug('Palette.popdown immediate %r' % immediate)
self._popup_anim.stop()
self._mouse_detector.stop()
@ -625,12 +627,14 @@ class Palette(gtk.Window):
self.show()
def __enter_notify_event_cb(self, widget, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
if event.detail != gtk.gdk.NOTIFY_INFERIOR and \
event.mode == gtk.gdk.CROSSING_NORMAL:
self._popdown_anim.stop()
self._secondary_anim.start()
def __leave_notify_event_cb(self, widget, event):
if event.detail != gtk.gdk.NOTIFY_INFERIOR:
if event.detail != gtk.gdk.NOTIFY_INFERIOR and \
event.mode == gtk.gdk.CROSSING_NORMAL:
self.popdown()
def __show_cb(self, widget):
@ -642,6 +646,7 @@ class Palette(gtk.Window):
self.emit('popup')
def __hide_cb(self, widget):
logging.debug('__hide_cb')
self.menu.set_active(False)
self._secondary_anim.stop()