diff --git a/gajim/gtk/chat_page.py b/gajim/gtk/chat_page.py index 5f296d97f996ea2141bdb2924dec0a0b97c16187..0504b409b1a6342296fe6b0f063ee350e36e1a04 100644 --- a/gajim/gtk/chat_page.py +++ b/gajim/gtk/chat_page.py @@ -151,12 +151,12 @@ def _on_chat_selected(self, account: str, jid: JID) -> None: - self._control_stack.show_chat(account, jid) + self._chat_stack.show_chat(account, jid) self._search_view.set_context(account, jid) self.emit('chat-selected', workspace_id, account, jid) def _on_chat_unselected(self, _chat_list_stack: ChatListStack) -> None: - self._control_stack.clear() + self._chat_stack.clear() self._search_view.set_context(None, None) def _on_search_history(self, @@ -185,7 +185,7 @@ def _on_chat_list_changed(self, self._ui.search_entry.set_text('') def process_event(self, event: ApplicationEvent): - self._control_stack.process_event(event) + self._chat_stack.process_event(event) self._chat_list_stack.process_event(event) def add_chat_list(self, workspace_id: str) -> None: diff --git a/gajim/gtk/chat_stack.py b/gajim/gtk/chat_stack.py index 2bb3e1601d7e42fffa4ff0e532f315171bfb80b8..16b296f173c89705612fd8625a9522c34f13fe56 100644 --- a/gajim/gtk/chat_stack.py +++ b/gajim/gtk/chat_stack.py @@ -12,9 +12,12 @@ # You should have received a copy of the GNU General Public License # along with Gajim. If not, see <http://www.gnu.org/licenses/>. +from typing import Any + import logging from gi.repository import Gtk +from nbxmpp.protocol import JID from .control_stack import ControlStack from .util import EventHelper @@ -32,7 +35,7 @@ def __init__(self): self._control_stack = ControlStack() - box = Gtk.Box() + box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) box.add(self._control_stack) self.add_named(box, 'controls') @@ -41,3 +44,12 @@ def __init__(self): def get_control_stack(self) -> ControlStack: return self._control_stack + + def show_chat(self, account: str, jid: JID) -> None: + self._control_stack.show_chat(account, jid) + + def clear(self) -> None: + self._control_stack.clear() + + def process_event(self, event: Any) -> None: + self._control_stack.process_event(event)