From 392c13472435b8e7957144218afc0ceba928ea04 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Thu, 16 Jan 2020 14:12:03 +0100 Subject: [PATCH 1/2] Use a HdyTitleBar Also add the .sidebar style class to the separator to make it still take the whole height. This will help dropping styling workarounds and ensure animating the headerbars work well. --- src/client/application/application-main-window.vala | 5 ++++- ui/main-toolbar.ui | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/application/application-main-window.vala b/src/client/application/application-main-window.vala index d605e027..97920ff6 100644 --- a/src/client/application/application-main-window.vala +++ b/src/client/application/application-main-window.vala @@ -1221,7 +1221,10 @@ public class Application.MainWindow : this.main_toolbar.show_close_button = false; this.main_layout.pack_start(main_toolbar, false, true, 0); } else { - set_titlebar(this.main_toolbar); + var titlebar = new Hdy.TitleBar(); + titlebar.show(); + titlebar.add(this.main_toolbar); + set_titlebar(titlebar); } // Status bar diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui index 5cf9e4d8..83b7b978 100644 --- a/ui/main-toolbar.ui +++ b/ui/main-toolbar.ui @@ -89,6 +89,9 @@ True False vertical + False From 0f907c5754ac34b5f8e974d354137258c04cd261 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Thu, 16 Jan 2020 14:23:21 +0100 Subject: [PATCH 2/2] main-toolbar: Drop the custom styles Drop the custom titlebar styles as they are not needed since we use HdyTitleBar, and since they can interfeer with it. --- src/client/components/main-toolbar.vala | 4 ---- ui/geary.css | 9 --------- ui/main-toolbar.ui | 9 --------- 3 files changed, 22 deletions(-) diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala index 5afaea6c..e4b55743 100644 --- a/src/client/components/main-toolbar.vala +++ b/src/client/components/main-toolbar.vala @@ -102,8 +102,6 @@ public class MainToolbar : Gtk.Box { public void set_conversation_header(Gtk.HeaderBar header) { conversation_header.hide(); - header.get_style_context().add_class("geary-titlebar"); - header.get_style_context().add_class("geary-titlebar-right"); guest_header_binding = bind_property("show-close-button-right", header, "show-close-button", BindingFlags.SYNC_CREATE); pack_start(header, true, true); @@ -112,8 +110,6 @@ public class MainToolbar : Gtk.Box { public void remove_conversation_header(Gtk.HeaderBar header) { remove(header); - header.get_style_context().remove_class("geary-titlebar"); - header.get_style_context().remove_class("geary-titlebar-right"); guest_header_binding.unbind(); header.decoration_layout = Gtk.Settings.get_default().gtk_decoration_layout; conversation_header.show(); diff --git a/ui/geary.css b/ui/geary.css index ab8c07fb..0b21e6b5 100644 --- a/ui/geary.css +++ b/ui/geary.css @@ -45,15 +45,6 @@ border-right: 0; } -.geary-titlebar-left:dir(ltr), -.geary-titlebar-right:dir(rtl) { - border-top-right-radius: 0px; -} -.geary-titlebar-right:dir(ltr), -.geary-titlebar-left:dir(rtl) { - border-top-left-radius: 0px; -} - /* MainWindowInfoBarSet */ .geary-info-bar-frame > border { diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui index 83b7b978..f7576f7d 100644 --- a/ui/main-toolbar.ui +++ b/ui/main-toolbar.ui @@ -73,10 +73,6 @@ 3 - False @@ -334,11 +330,6 @@ 4 - True