From 7753d0a7f71683312f6e4005fa3d8f8a1e3ea38a Mon Sep 17 00:00:00 2001 From: James Westman Date: Wed, 1 Jan 2020 19:25:54 -0600 Subject: [PATCH] composer: Better UI for Cc/Bcc/Reply-To fields Implemented according to the mockups at . - Use an animated revealer rather than instantly showing/hiding the fields - Include Cc in the "extended fields" - Use a toggle button instead of a menu item to show/hide these fields, for better discoverability --- src/client/composer/composer-widget.vala | 14 +- ui/composer-menus.ui | 12 - ui/composer-widget.ui | 512 +++++++++++++++-------- 3 files changed, 336 insertions(+), 202 deletions(-) diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala index e46bc6f3..123d59e3 100644 --- a/src/client/composer/composer-widget.vala +++ b/src/client/composer/composer-widget.vala @@ -317,12 +317,15 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { private Gee.ArrayList from_list = new Gee.ArrayList(); [GtkChild] - private Gtk.EventBox to_box; + private Gtk.Box to_box; [GtkChild] private Gtk.Label to_label; private EmailEntry to_entry; private Components.EntryUndo to_undo; + [GtkChild] + private Gtk.Revealer extended_fields_revealer; + [GtkChild] private Gtk.EventBox cc_box; [GtkChild] @@ -508,7 +511,7 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { this.to_entry = new EmailEntry(this); this.to_entry.changed.connect(on_envelope_changed); - this.to_box.add(to_entry); + this.to_box.pack_start(to_entry, true, true); this.to_label.set_mnemonic_widget(this.to_entry); this.to_undo = new Components.EntryUndo(this.to_entry); @@ -530,8 +533,6 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { this.reply_to_label.set_mnemonic_widget(this.reply_to_entry); this.reply_to_undo = new Components.EntryUndo(this.reply_to_entry); - this.to_entry.margin_top = this.cc_entry.margin_top = this.bcc_entry.margin_top = this.reply_to_entry.margin_top = 6; - this.subject_undo = new Components.EntryUndo(this.subject_entry); this.subject_spell_entry = Gspell.Entry.get_from_gtk_entry( this.subject_entry @@ -2138,10 +2139,7 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { GLib.Variant? new_state) { bool show_extended = new_state.get_boolean(); action.set_state(show_extended); - this.bcc_label.visible = - this.bcc_entry.visible = - this.reply_to_label.visible = - this.reply_to_entry.visible = show_extended; + this.extended_fields_revealer.reveal_child = show_extended; if (show_extended && this.current_mode == INLINE_COMPACT) { set_mode(INLINE); diff --git a/ui/composer-menus.ui b/ui/composer-menus.ui index 66554ac2..2f4c342f 100644 --- a/ui/composer-menus.ui +++ b/ui/composer-menus.ui @@ -48,12 +48,6 @@ win.compose-as-html -
- - Show Extended Fields - win.show-extended - -
@@ -63,12 +57,6 @@ win.compose-as-html -
- - Show Extended Fields - win.show-extended-headers - -
diff --git a/ui/composer-widget.ui b/ui/composer-widget.ui index b4821843..57ee5157 100644 --- a/ui/composer-widget.ui +++ b/ui/composer-widget.ui @@ -1,5 +1,5 @@ - + + + + + + + + + + +