From d5a5afcc782cde5b065bcbd1e7a9f9e0d533ad73 Mon Sep 17 00:00:00 2001 From: James Westman Date: Wed, 15 Jan 2020 22:12:34 -0600 Subject: [PATCH] composer: More tweaks to match mockups - Move the attachment button(s) out of the headerbar into the action bar - Add a cancel button - Adjust some margins - Set popover positions to top - Remove subject from headerbar title to save horizontal space --- src/client/composer/composer-headerbar.vala | 9 --- src/client/composer/composer-widget.vala | 13 +-- src/client/composer/spell-check-popover.vala | 3 +- ui/composer-headerbar.ui | 84 ++----------------- ui/composer-link-popover.ui | 2 +- ui/composer-widget.ui | 85 ++++++++++++++++++++ 6 files changed, 104 insertions(+), 92 deletions(-) diff --git a/src/client/composer/composer-headerbar.vala b/src/client/composer/composer-headerbar.vala index 4fde97cd..0b1bbd53 100644 --- a/src/client/composer/composer-headerbar.vala +++ b/src/client/composer/composer-headerbar.vala @@ -26,10 +26,6 @@ public class Composer.Headerbar : Gtk.HeaderBar { [GtkChild] private Gtk.Label recipients_label; [GtkChild] - private Gtk.Button new_message_attach_button; - [GtkChild] - private Gtk.Box conversation_attach_buttons; - [GtkChild] private Gtk.Button save_and_close_button; @@ -56,11 +52,6 @@ public class Composer.Headerbar : Gtk.HeaderBar { recipients_button.tooltip_text = tooltip; } - public void set_show_pending_attachments(bool show) { - this.new_message_attach_button.visible = !show; - this.conversation_attach_buttons.visible = show; - } - internal void set_mode(Widget.PresentationMode mode) { switch (mode) { case Widget.PresentationMode.DETACHED: diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala index e09a8806..6c490cf5 100644 --- a/src/client/composer/composer-widget.vala +++ b/src/client/composer/composer-widget.vala @@ -373,6 +373,10 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { private Gtk.Widget recipients; [GtkChild] private Gtk.Box header_area; + + [GtkChild] private Gtk.Button new_message_attach_button; + [GtkChild] private Gtk.Box conversation_attach_buttons; + [GtkChild] private Gtk.Revealer formatting; [GtkChild] private Gtk.Box toolbar_box; [GtkChild] private Gtk.Box top_buttons; @@ -1431,10 +1435,6 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { if (this.container != null) { this.container.top_window.title = subject; } - - if (this.application.config.desktop_environment != UNITY) { - this.header.title = subject; - } } internal void set_mode(PresentationMode new_mode) { @@ -1802,7 +1802,10 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { } } } - this.header.set_show_pending_attachments(manual_enabled); + + this.new_message_attach_button.visible = !manual_enabled; + this.conversation_attach_buttons.visible = manual_enabled; + return have_added; } diff --git a/src/client/composer/spell-check-popover.vala b/src/client/composer/spell-check-popover.vala index c04183c0..44dfa021 100644 --- a/src/client/composer/spell-check-popover.vala +++ b/src/client/composer/spell-check-popover.vala @@ -60,6 +60,8 @@ public class SpellCheckPopover { this.is_lang_visible = is_active || is_visible; Gtk.Box box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6); + box.margin = 6; + box.margin_start = 12; lang_name = Util.International.language_name_from_locale(lang_code); country_name = Util.International.country_name_from_locale(lang_code); @@ -69,7 +71,6 @@ public class SpellCheckPopover { label_text += " (" + country_name + ")"; Gtk.Label label = new Gtk.Label(label_text); label.set_halign(Gtk.Align.START); - label.set_size_request(-1, 24); box.pack_start(label, false, false); diff --git a/ui/composer-headerbar.ui b/ui/composer-headerbar.ui index 930854f0..2e2501d0 100644 --- a/ui/composer-headerbar.ui +++ b/ui/composer-headerbar.ui @@ -5,6 +5,11 @@