aboutsummaryrefslogtreecommitdiff
path: root/src/ChatWindow.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-11-03 06:04:57 +0100
committerdec05eba <dec05eba@protonmail.com>2018-11-03 06:05:03 +0100
commit405459e93be718b0e6aad26746036105dd3f3226 (patch)
tree1d3a94bbbf2e58c334cf2234357719f4a3fe2af8 /src/ChatWindow.cpp
parent8cc8853c3c1e5dfd7681bc0c31bc0eb88a4ef959 (diff)
Improve top bar, have to fix banding...
Diffstat (limited to 'src/ChatWindow.cpp')
-rw-r--r--src/ChatWindow.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/ChatWindow.cpp b/src/ChatWindow.cpp
index 273f0e0..b53e337 100644
--- a/src/ChatWindow.cpp
+++ b/src/ChatWindow.cpp
@@ -57,17 +57,31 @@ namespace dchat
topbar.set_hexpand(true);
attach(topbar, 0, 0, 2, 1);
- topbarSearchBar.set_size_request(175);
+ Gtk::Grid *topbarLeft = Gtk::manage(new Gtk::Grid());
+ topbarLeft->set_name("top-bar-left");
+ topbarLeft->set_size_request(180);
+ topbarLeft->set_valign(Gtk::ALIGN_CENTER);
+ topbarLeft->set_halign(Gtk::ALIGN_CENTER);
+ topbar.attach(*topbarLeft, 0, 0, 1, 1);
+
topbarSearchBar.set_name("top-bar-search");
topbarSearchBar.set_placeholder_text("Search...");
- topbar.attach(topbarSearchBar, 0, 0, 1, 1);
+ topbarSearchBar.set_size_request(180);
+ topbarLeft->attach(topbarSearchBar, 0, 0, 1, 1);
- Gtk::Alignment *topbarSpacer = Gtk::manage(new Gtk::Alignment());
- topbarSpacer->set_size_request(50);
- topbar.attach_next_to(*topbarSpacer, topbarSearchBar, Gtk::POS_RIGHT, 1, 1);
+ Gtk::Grid *topbarRight = Gtk::manage(new Gtk::Grid());
+ topbarRight->set_name("top-bar-right");
+ topbarRight->set_hexpand(true);
+ topbarRight->set_valign(Gtk::ALIGN_CENTER);
+ topbar.attach_next_to(*topbarRight, *topbarLeft, Gtk::POS_RIGHT, 1, 1);
currentChannelTitle.set_name("current-room-title");
- topbar.attach_next_to(currentChannelTitle, *topbarSpacer, Gtk::POS_RIGHT, 1, 1);
+ currentChannelTitle.set_hexpand(true);
+ currentChannelTitle.set_alignment(Gtk::ALIGN_START, Gtk::ALIGN_CENTER);
+ topbarRight->attach(currentChannelTitle, 0, 0, 1, 1);
+
+ ImageButton *channelSettings = Gtk::manage(new ImageButton("images/settings-icon.png", nullptr));
+ topbarRight->attach_next_to(*channelSettings, currentChannelTitle, Gtk::POS_RIGHT, 1, 1);
}
void ChatWindow::setupLeftPanel(Gtk::Paned *sidePanels)