Fix frame behavior on chat; when we show the chat remember previous frame state and return to it when we hide chat

This commit is contained in:
Dan Williams 2006-09-28 16:12:07 -04:00
parent a91738d3a9
commit ef539c50d9
2 changed files with 18 additions and 6 deletions

View File

@ -96,11 +96,15 @@ class ActivityHost:
dialog.show() dialog.show()
dialog.window.set_transient_for(self._gdk_window) 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._chat_window.show_all()
self._frame_was_visible = frame_was_visible
def chat_hide(self): def chat_hide(self):
self._chat_window.hide() self._chat_window.hide()
wasvis = self._frame_was_visible
self._frame_was_visible = False
return wasvis
def is_chat_visible(self): def is_chat_visible(self):
return self._chat_window.get_property('visible') return self._chat_window.get_property('visible')
@ -108,8 +112,10 @@ class ActivityHost:
def _activity_changed_cb(self, shell, activity): def _activity_changed_cb(self, shell, activity):
if activity != self: if activity != self:
self.chat_hide() self.chat_hide()
self._frame_was_visible = False
def _activity_closed_cb(self, shell, activity): def _activity_closed_cb(self, shell, activity):
if activity == self: if activity == self:
self.chat_hide() self.chat_hide()
self._frame_was_visible = False

View File

@ -153,8 +153,14 @@ class Shell(gobject.GObject):
def _show_hide_activity_chat(self): def _show_hide_activity_chat(self):
act = self.get_current_activity() act = self.get_current_activity()
if act: if not act:
if act.is_chat_visible(): return
act.chat_hide() is_visible = self._frame.is_visible()
else: if act.is_chat_visible():
act.chat_show() 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)