[geary] Use separator within Gtk.Headerbar in MainToolbar
- From: Robert Schroll <rschroll src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Use separator within Gtk.Headerbar in MainToolbar
- Date: Fri, 13 Mar 2015 21:10:07 +0000 (UTC)
commit 55ecbb69212bc9d14f976e210fd4fb6d80c3bbc8
Author: Robert Schroll <rschroll gmail com>
Date: Fri Mar 13 15:16:45 2015 -0400
Use separator within Gtk.Headerbar in MainToolbar
This produces better styling under Ambiance.
https://bugzilla.gnome.org/show_bug.cgi?id=746171
src/client/components/main-toolbar.vala | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 629e574..80de811 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -16,6 +16,7 @@ public class MainToolbar : Gtk.Box {
public bool show_close_button_left { get; private set; }
public bool show_close_button_right { get; private set; }
public bool search_open { get; set; default = false; }
+ public int left_pane_width { get; set; }
private PillHeaderbar folder_header;
private PillHeaderbar conversation_header;
@@ -32,8 +33,19 @@ public class MainToolbar : Gtk.Box {
folder_header.get_style_context().add_class("geary-titlebar-left");
conversation_header.get_style_context().add_class("titlebar");
conversation_header.get_style_context().add_class("geary-titlebar-right");
+
+ // Instead of putting a separator between the two headerbars, as other applications do,
+ // we put a separator at the right end of the left headerbar. This greatly improves
+ // the appearance under the Ambiance theme (see bug #746171). To get this separator to
+ // line up with the handle of the pane, we need to extend the width of the left-hand
+ // headerbar a bit. Six pixels is right both for Adwaita and Ambiance.
GearyApplication.instance.config.bind(Configuration.MESSAGES_PANE_POSITION_KEY,
- folder_header, "width-request", SettingsBindFlags.GET);
+ this, "left-pane-width", SettingsBindFlags.GET);
+ this.bind_property("left-pane-width", folder_header, "width-request",
+ BindingFlags.SYNC_CREATE, (binding, source_value, ref target_value) => {
+ target_value = left_pane_width + 6;
+ return true;
+ });
this.bind_property("account", folder_header, "title", BindingFlags.SYNC_CREATE);
this.bind_property("folder", folder_header, "subtitle", BindingFlags.SYNC_CREATE);
@@ -87,7 +99,9 @@ public class MainToolbar : Gtk.Box {
#if !GTK_3_12
folder_header.add_end(empty);
folder_header.add_end(search);
+ folder_header.add_end(new Gtk.Separator(Gtk.Orientation.VERTICAL));
#else
+ folder_header.add_end(new Gtk.Separator(Gtk.Orientation.VERTICAL));
folder_header.add_end(search);
folder_header.add_end(empty);
#endif
@@ -161,7 +175,6 @@ public class MainToolbar : Gtk.Box {
conversation_header.set_custom_title(title_box);
pack_start(folder_header, false, false);
- pack_start(new Gtk.Separator(Gtk.Orientation.VERTICAL), false, false);
pack_start(conversation_header, true, true);
get_style_context().changed.connect(set_close_buttons_side);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]