diff options
author | Dan Williams <dcbw@localhost.localdomain> | 2006-09-28 20:12:07 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@localhost.localdomain> | 2006-09-28 20:12:07 (GMT) |
commit | ef539c50d9eadec934da5ba7b145c41f694518f1 (patch) | |
tree | 7d239476cdc684ee971df39abcefe8d54bf07e9b /shell | |
parent | a91738d3a9a85b46952995df12ed473692e5c2e6 (diff) |
Fix frame behavior on chat; when we show the chat remember previous frame state and return to it when we hide chat
Diffstat (limited to 'shell')
-rw-r--r-- | shell/view/ActivityHost.py | 8 | ||||
-rw-r--r-- | shell/view/Shell.py | 16 |
2 files changed, 18 insertions, 6 deletions
diff --git a/shell/view/ActivityHost.py b/shell/view/ActivityHost.py index 4524f56..43ed38c 100644 --- a/shell/view/ActivityHost.py +++ b/shell/view/ActivityHost.py @@ -96,11 +96,15 @@ class ActivityHost: dialog.show() dialog.window.set_transient_for(self._gdk_window) - def chat_show(self): + def chat_show(self, frame_was_visible): self._chat_window.show_all() + self._frame_was_visible = frame_was_visible def chat_hide(self): self._chat_window.hide() + wasvis = self._frame_was_visible + self._frame_was_visible = False + return wasvis def is_chat_visible(self): return self._chat_window.get_property('visible') @@ -108,8 +112,10 @@ class ActivityHost: def _activity_changed_cb(self, shell, activity): if activity != self: self.chat_hide() + self._frame_was_visible = False def _activity_closed_cb(self, shell, activity): if activity == self: self.chat_hide() + self._frame_was_visible = False diff --git a/shell/view/Shell.py b/shell/view/Shell.py index e5274b8..c9a2c4d 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -153,8 +153,14 @@ class Shell(gobject.GObject): def _show_hide_activity_chat(self): act = self.get_current_activity() - if act: - if act.is_chat_visible(): - act.chat_hide() - else: - act.chat_show() + if not act: + return + is_visible = self._frame.is_visible() + if act.is_chat_visible(): + frame_was_visible = act.chat_hide() + if not frame_was_visible: + self._frame.do_slide_out() + else: + if not is_visible: + self._frame.do_slide_in() + act.chat_show(is_visible) |