From d041eadf9220ff88e11181ce4d5465f9b07b1a8c Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 13 Mar 2007 00:19:21 +0100 Subject: [PATCH] Give up on the save/restore logic, it seem too unpredictable to be clear to the user. Try a simpler logic where the frame state is reset when switching zoom levels. --- shell/view/Shell.py | 10 +++------- shell/view/frame/frame.py | 21 --------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/shell/view/Shell.py b/shell/view/Shell.py index 4a2801af..3f0ef8fe 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -61,8 +61,6 @@ class Shell(gobject.GObject): activity_host = ActivityHost(home_activity) self._hosts[activity_host.get_xid()] = activity_host - self._frame.hide() - def _activity_removed_cb(self, home_model, home_activity): if not home_activity.get_launched(): return @@ -84,7 +82,7 @@ class Shell(gobject.GObject): if self._current_host: self._current_host.set_active(True) - self._zoom_level = sugar.ZOOM_ACTIVITY + self.set_zoom_level(sugar.ZOOM_ACTIVITY) else: self.set_zoom_level(sugar.ZOOM_HOME) @@ -148,9 +146,6 @@ class Shell(gobject.GObject): if len(self._hosts) == 0 and level == sugar.ZOOM_ACTIVITY: return - if self._zoom_level == sugar.ZOOM_HOME: - self._frame.restore_state() - self._zoom_level = level if self._zoom_level == sugar.ZOOM_ACTIVITY: @@ -160,8 +155,9 @@ class Shell(gobject.GObject): self._home_window.set_zoom_level(self._zoom_level) if self._zoom_level == sugar.ZOOM_HOME: - self._frame.save_state() self._frame.show() + else: + self._frame.hide() def get_current_activity(self): return self._current_host diff --git a/shell/view/frame/frame.py b/shell/view/frame/frame.py index c34a85d7..11aea677 100644 --- a/shell/view/frame/frame.py +++ b/shell/view/frame/frame.py @@ -110,11 +110,6 @@ class _KeyListener(object): self._hide_sid = gobject.timeout_add( 100, self._hide_frame_timeout_cb) -class _FrameState(object): - def __init__(self, visible, mode): - self.visible = visible - self.mode = mode - class Frame(object): def __init__(self, shell): self.mode = MODE_NONE @@ -129,7 +124,6 @@ class Frame(object): self._current_position = 0.0 self._animator = None self._hover = False - self._saved_state = None self._event_frame = EventFrame() self._event_frame.connect('enter-corner', self._enter_corner_cb) @@ -155,21 +149,6 @@ class Frame(object): self._key_listener = _KeyListener(self) self._mouse_listener = _MouseListener(self) - self.save_state() - - def save_state(self): - self._saved_state = _FrameState(self.visible, self.mode) - - def restore_state(self): - if self._saved_state == None: - return - - if self._saved_state.visible: - self.show() - else: - self.hide() - self.mode = self._saved_state.mode - def hide(self, force=False): if not self.visible: return