Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-09-22 09:14:33 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-09-22 09:14:33 (GMT)
commit2d8c9a3310714a5281a2c6250bc341103752e28f (patch)
treee32499d4350268ac710515ece632aff29279e482
parent5e55efe9d527ac1e5a557f07346915d6cfd1984e (diff)
Implement activation modes. Do not hide when sticky because
activated by single frame key press.
-rw-r--r--shell/view/frame/Frame.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/shell/view/frame/Frame.py b/shell/view/frame/Frame.py
index 6656b64..ef0077a 100644
--- a/shell/view/frame/Frame.py
+++ b/shell/view/frame/Frame.py
@@ -100,10 +100,16 @@ class EventFrame(gobject.GObject):
window.window.raise_()
class Frame:
+ INACTIVE = 0
+ TEMPORARY = 1
+ STICKY = 2
+ HIDE_ON_LEAVE = 3
+ AUTOMATIC = 4
+
def __init__(self, shell):
self._windows = []
self._shell = shell
- self._sticky = False
+ self._mode = Frame.INACTIVE
self._timeline = Timeline(self)
self._timeline.add_tag('slide_in', 6, 12)
@@ -160,38 +166,48 @@ class Frame:
self._timeline.goto('slide_in', True)
def _menu_shell_deactivated_cb(self, menu_shell):
- self._timeline.play('before_slide_out', 'slide_out')
+ if self._mode != Frame.STICKY:
+ self._timeline.play('before_slide_out', 'slide_out')
def _enter_notify_cb(self, window, event):
self._timeline.goto('slide_in', True)
def _leave_notify_cb(self, window, event):
- if not self._menu_shell.is_active():
+ # FIXME for some reason every click cause also a leave-notify
+ if event.state == gtk.gdk.BUTTON1_MASK:
+ return
+
+ if not self._menu_shell.is_active() and \
+ self._mode == Frame.HIDE_ON_LEAVE:
self._timeline.play('before_slide_out', 'slide_out')
def _enter_edge_cb(self, event_frame):
+ self._mode = Frame.HIDE_ON_LEAVE
self._timeline.play(None, 'slide_in')
def _enter_corner_cb(self, event_frame):
+ self._mode = Frame.HIDE_ON_LEAVE
self._timeline.play('slide_in', 'slide_in')
def _event_frame_leave_cb(self, event_frame):
- self._timeline.goto('slide_out', True)
+ if self._mode != Frame.STICKY:
+ self._timeline.goto('slide_out', True)
def show_and_hide(self, seconds):
+ self._mode = Frame.AUTOMATIC
self._timeline.play()
def notify_key_press(self):
if self._timeline.on_tag('slide_in'):
self._timeline.play('before_slide_out', 'slide_out')
elif self._timeline.on_tag('before_slide_out'):
- self._sticky = True
+ self._mode = Frame.TEMPORARY
else:
- self._sticky = False
+ self._mode = Frame.STICKY
self._timeline.play('slide_in', 'slide_in')
def notify_key_release(self):
- if self._sticky:
+ if self._mode == Frame.TEMPORARY:
self._timeline.play('before_slide_out', 'slide_out')
def do_slide_in(self, current, n_frames):