diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-05-03 00:47:43 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-05-03 00:47:43 -0400 |
commit | 8b22c7c2cf3f85d6664d97c29a98df7e4bbe8981 (patch) | |
tree | ecaef24b6b09c2255bebca916589faa8361aa2c9 /windows | |
parent | 5394c67079deaca5e89a4553187e26e29be0d23c (diff) | |
download | abaddon-portaudio-8b22c7c2cf3f85d6664d97c29a98df7e4bbe8981.tar.gz abaddon-portaudio-8b22c7c2cf3f85d6664d97c29a98df7e4bbe8981.zip |
pull central pane (chat) into a stack
Diffstat (limited to 'windows')
-rw-r--r-- | windows/mainwindow.cpp | 38 | ||||
-rw-r--r-- | windows/mainwindow.hpp | 6 |
2 files changed, 26 insertions, 18 deletions
diff --git a/windows/mainwindow.cpp b/windows/mainwindow.cpp index d1598c6..1ab79ec 100644 --- a/windows/mainwindow.cpp +++ b/windows/mainwindow.cpp @@ -1,11 +1,12 @@ #include "mainwindow.hpp" #include "../abaddon.hpp" +#include "../components/friendslist.hpp" MainWindow::MainWindow() : m_main_box(Gtk::ORIENTATION_VERTICAL) , m_content_box(Gtk::ORIENTATION_HORIZONTAL) - , m_chan_chat_paned(Gtk::ORIENTATION_HORIZONTAL) - , m_chat_members_paned(Gtk::ORIENTATION_HORIZONTAL) { + , m_chan_content_paned(Gtk::ORIENTATION_HORIZONTAL) + , m_content_members_paned(Gtk::ORIENTATION_HORIZONTAL) { set_default_size(1200, 800); get_style_context()->add_class("app-window"); @@ -110,22 +111,27 @@ MainWindow::MainWindow() member_list->set_vexpand(true); member_list->show(); - m_chan_chat_paned.pack1(*channel_list); - m_chan_chat_paned.pack2(m_chat_members_paned); - m_chan_chat_paned.child_property_shrink(*channel_list) = false; - m_chan_chat_paned.child_property_resize(*channel_list) = false; - m_chan_chat_paned.set_position(200); - m_chan_chat_paned.show(); - m_content_box.add(m_chan_chat_paned); - - m_chat_members_paned.pack1(*chat); - m_chat_members_paned.pack2(*member_list); - m_chat_members_paned.child_property_shrink(*member_list) = false; - m_chat_members_paned.child_property_resize(*member_list) = false; + m_content_stack.add(*chat); + m_content_stack.set_vexpand(true); + m_content_stack.set_hexpand(true); + m_content_stack.show(); + + m_chan_content_paned.pack1(*channel_list); + m_chan_content_paned.pack2(m_content_members_paned); + m_chan_content_paned.child_property_shrink(*channel_list) = false; + m_chan_content_paned.child_property_resize(*channel_list) = false; + m_chan_content_paned.set_position(200); + m_chan_content_paned.show(); + m_content_box.add(m_chan_content_paned); + + m_content_members_paned.pack1(m_content_stack); + m_content_members_paned.pack2(*member_list); + m_content_members_paned.child_property_shrink(*member_list) = false; + m_content_members_paned.child_property_resize(*member_list) = false; int w, h; get_default_size(w, h); // :s - m_chat_members_paned.set_position(w - m_chan_chat_paned.get_position() - 150); - m_chat_members_paned.show(); + m_content_members_paned.set_position(w - m_chan_content_paned.get_position() - 150); + m_content_members_paned.show(); add(m_main_box); } diff --git a/windows/mainwindow.hpp b/windows/mainwindow.hpp index b1803ad..0be4bc0 100644 --- a/windows/mainwindow.hpp +++ b/windows/mainwindow.hpp @@ -68,13 +68,15 @@ protected: protected: Gtk::Box m_main_box; Gtk::Box m_content_box; - Gtk::Paned m_chan_chat_paned; - Gtk::Paned m_chat_members_paned; + Gtk::Paned m_chan_content_paned; + Gtk::Paned m_content_members_paned; ChannelList m_channel_list; ChatWindow m_chat; MemberList m_members; + Gtk::Stack m_content_stack; + Gtk::MenuBar m_menu_bar; Gtk::MenuItem m_menu_discord; Gtk::Menu m_menu_discord_sub; |