There are 4 different menu shells on the panel, check against the right one.
This commit is contained in:
parent
93e030216c
commit
f20348a5fd
@ -264,11 +264,11 @@ class Frame:
|
|||||||
panel.connect('enter-notify-event', self._enter_notify_cb)
|
panel.connect('enter-notify-event', self._enter_notify_cb)
|
||||||
panel.connect('leave-notify-event', self._leave_notify_cb)
|
panel.connect('leave-notify-event', self._leave_notify_cb)
|
||||||
|
|
||||||
self._menu_shell = panel.get_menu_shell()
|
menu_shell = panel.get_menu_shell()
|
||||||
self._menu_shell.connect('activated',
|
menu_shell.connect('activated',
|
||||||
self._menu_shell_activated_cb)
|
self._menu_shell_activated_cb)
|
||||||
self._menu_shell.connect('deactivated',
|
menu_shell.connect('deactivated',
|
||||||
self._menu_shell_deactivated_cb)
|
self._menu_shell_deactivated_cb)
|
||||||
|
|
||||||
def _menu_shell_activated_cb(self, menu_shell):
|
def _menu_shell_activated_cb(self, menu_shell):
|
||||||
self._timeline.goto('slide_in', True)
|
self._timeline.goto('slide_in', True)
|
||||||
@ -287,7 +287,7 @@ class Frame:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def _drag_leave_cb(self, window, drag_context, timestamp):
|
def _drag_leave_cb(self, window, drag_context, timestamp):
|
||||||
self._leave_notify()
|
self._leave_notify(window)
|
||||||
logging.debug('Frame._drag_leave_cb ' + str(self._mode))
|
logging.debug('Frame._drag_leave_cb ' + str(self._mode))
|
||||||
|
|
||||||
def _leave_notify_cb(self, window, event):
|
def _leave_notify_cb(self, window, event):
|
||||||
@ -295,16 +295,16 @@ class Frame:
|
|||||||
if event.state == gtk.gdk.BUTTON1_MASK:
|
if event.state == gtk.gdk.BUTTON1_MASK:
|
||||||
return
|
return
|
||||||
|
|
||||||
self._leave_notify()
|
self._leave_notify(window)
|
||||||
logging.debug('Frame._leave_notify_cb ' + str(self._mode))
|
logging.debug('Frame._leave_notify_cb ' + str(self._mode))
|
||||||
|
|
||||||
def _enter_notify(self):
|
def _enter_notify(self):
|
||||||
self._hover_frame = True
|
self._hover_frame = True
|
||||||
self._timeline.goto('slide_in', True)
|
self._timeline.goto('slide_in', True)
|
||||||
|
|
||||||
def _leave_notify(self):
|
def _leave_notify(self, panel):
|
||||||
self._hover_frame = False
|
self._hover_frame = False
|
||||||
if not self._menu_shell.is_active() and \
|
if not panel.get_menu_shell().is_active() and \
|
||||||
(self._mode == Frame.HIDE_ON_LEAVE or \
|
(self._mode == Frame.HIDE_ON_LEAVE or \
|
||||||
self._mode == Frame.AUTOMATIC):
|
self._mode == Frame.AUTOMATIC):
|
||||||
self._timeline.play('before_slide_out', 'slide_out')
|
self._timeline.play('before_slide_out', 'slide_out')
|
||||||
|
Loading…
Reference in New Issue
Block a user