diff --git a/gajim/gtk/chat_page.py b/gajim/gtk/chat_page.py index 255131d9a3bc5270d2ad0d6da489a5ec3731630c..5f296d97f996ea2141bdb2924dec0a0b97c16187 100644 --- a/gajim/gtk/chat_page.py +++ b/gajim/gtk/chat_page.py @@ -34,6 +34,7 @@ from .chat_filter import ChatFilter from .chat_list import ChatList from .chat_list_stack import ChatListStack +from .chat_stack import ChatStack from .control_stack import ControlStack from .search_view import SearchView from .types import ControlT @@ -57,8 +58,10 @@ def __init__(self): self.add(self._ui.paned) self._ui.connect_signals(self) - self._control_stack = ControlStack() - self._ui.right_grid_overlay.add(self._control_stack) + self._chat_stack = ChatStack() + self._ui.right_grid_overlay.add(self._chat_stack) + + self._control_stack = self._chat_stack.get_control_stack() self._search_view = SearchView() self._search_view.connect('hide-search', self._on_search_hide) diff --git a/gajim/gtk/chat_stack.py b/gajim/gtk/chat_stack.py new file mode 100644 index 0000000000000000000000000000000000000000..2bb3e1601d7e42fffa4ff0e532f315171bfb80b8 --- /dev/null +++ b/gajim/gtk/chat_stack.py @@ -0,0 +1,43 @@ +# This file is part of Gajim. +# +# Gajim is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; version 3 only. +# +# Gajim is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Gajim. If not, see <http://www.gnu.org/licenses/>. + +import logging + +from gi.repository import Gtk + +from .control_stack import ControlStack +from .util import EventHelper + +log = logging.getLogger('gajim.gui.chatstack') + + +class ChatStack(Gtk.Stack, EventHelper): + def __init__(self): + Gtk.Stack.__init__(self) + EventHelper.__init__(self) + + self.set_vexpand(True) + self.set_hexpand(True) + + self._control_stack = ControlStack() + + box = Gtk.Box() + box.add(self._control_stack) + + self.add_named(box, 'controls') + + self.show_all() + + def get_control_stack(self) -> ControlStack: + return self._control_stack diff --git a/pyrightconfig.json b/pyrightconfig.json index b3c0f65319d51e352643c937922711d8cb6df6b6..c23ac82ff53b6184e1090f4e93e616752d37c716 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -61,6 +61,7 @@ "gajim/gtk/chat_list_stack.py", "gajim/gtk/chat_list.py", "gajim/gtk/chat_page.py", + "gajim/gtk/chat_stack.py", "gajim/gtk/control_stack.py", "gajim/gtk/const.py", "gajim/gtk/contact_info.py",