[geary: 5/8] composer: More tweaks to match mockups



commit d5a5afcc782cde5b065bcbd1e7a9f9e0d533ad73
Author: James Westman <flyingpimonster gmail com>
Date:   Wed Jan 15 22:12:34 2020 -0600

    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 @@
   <template class="ComposerHeaderbar" parent="GtkHeaderBar">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
+    <child type="title">
+      <object class="GtkBox">
+        <property name="visible">False</property>
+      </object>
+    </child>
     <child>
       <object class="GtkBox" id="detach_start">
         <property name="visible">True</property>
@@ -50,85 +55,12 @@
       </object>
     </child>
     <child>
-      <object class="GtkButton" id="new_message_attach_button">
+      <object class="GtkButton">
         <property name="visible">True</property>
         <property name="can_focus">True</property>
-        <property name="focus_on_click">False</property>
-        <property name="receives_default">False</property>
-        <property name="tooltip_text" translatable="yes">Attach a file</property>
-        <property name="action_name">cmh.add-attachment</property>
-        <property name="always_show_image">True</property>
-        <child>
-          <object class="GtkImage" id="new_message_attach_image">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="pixel_size">16</property>
-            <property name="icon_name">mail-attachment-symbolic</property>
-          </object>
-        </child>
+        <property name="label">Cancel</property>
+        <property name="action_name">cmh.composer-close</property>
       </object>
-      <packing>
-        <property name="position">1</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkBox" id="conversation_attach_buttons">
-        <property name="can_focus">False</property>
-        <child>
-          <object class="GtkButton" id="conversation_attach_new_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="focus_on_click">False</property>
-            <property name="receives_default">False</property>
-            <property name="tooltip_text" translatable="yes">Attach a file</property>
-            <property name="action_name">cmh.add-attachment</property>
-            <property name="always_show_image">True</property>
-            <child>
-              <object class="GtkImage" id="conversation_attach_new_image">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pixel_size">16</property>
-                <property name="icon_name">mail-attachment-symbolic</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButton" id="conversation_attach_original_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="focus_on_click">False</property>
-            <property name="receives_default">False</property>
-            <property name="tooltip_text" translatable="yes">Add original attachments</property>
-            <property name="action_name">cmh.add-original-attachments</property>
-            <property name="always_show_image">True</property>
-            <child>
-              <object class="GtkImage" id="conversation_attach_original_image">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="pixel_size">16</property>
-                <property name="icon_name">edit-copy-symbolic</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <style>
-          <class name="linked"/>
-        </style>
-      </object>
-      <packing>
-        <property name="position">2</property>
-      </packing>
     </child>
     <child>
       <object class="GtkButton" id="recipients_button">
diff --git a/ui/composer-link-popover.ui b/ui/composer-link-popover.ui
index 56bb7572..0d4a9396 100644
--- a/ui/composer-link-popover.ui
+++ b/ui/composer-link-popover.ui
@@ -4,7 +4,7 @@
   <requires lib="gtk+" version="3.14"/>
   <template class="ComposerLinkPopover" parent="GtkPopover">
     <property name="can_focus">False</property>
-    <property name="position">bottom</property>
+    <property name="position">top</property>
     <child>
       <object class="GtkGrid">
         <property name="visible">True</property>
diff --git a/ui/composer-widget.ui b/ui/composer-widget.ui
index 94768a21..e48412ed 100644
--- a/ui/composer-widget.ui
+++ b/ui/composer-widget.ui
@@ -831,6 +831,7 @@
                                 <property name="can_focus">True</property>
                                 <property name="menu_model">font_menu</property>
                                 <property name="tooltip_text" translatable="yes">Change font type</property>
+                                <property name="direction">up</property>
                                 <child>
                                   <object class="GtkBox">
                                     <property name="visible">True</property>
@@ -906,6 +907,7 @@
                                 <property name="can_focus">True</property>
                                 <property name="menu_model">font_size_menu</property>
                                 <property name="tooltip_text" translatable="yes">Change font size</property>
+                                <property name="direction">up</property>
                                 <child>
                                   <object class="GtkBox">
                                     <property name="visible">True</property>
@@ -1054,6 +1056,87 @@
                     </style>
                   </object>
                 </child>
+                <child>
+                  <object class="GtkButton" id="new_message_attach_button">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="focus_on_click">False</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_text" translatable="yes">Attach a file</property>
+                    <property name="action_name">win.add-attachment</property>
+                    <property name="always_show_image">True</property>
+                    <child>
+                      <object class="GtkImage" id="new_message_attach_image">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="pixel_size">16</property>
+                        <property name="icon_name">mail-attachment-symbolic</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkBox" id="conversation_attach_buttons">
+                    <property name="can_focus">False</property>
+                    <child>
+                      <object class="GtkButton" id="conversation_attach_new_button">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="focus_on_click">False</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Attach a file</property>
+                        <property name="action_name">win.add-attachment</property>
+                        <property name="always_show_image">True</property>
+                        <child>
+                          <object class="GtkImage" id="conversation_attach_new_image">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="pixel_size">16</property>
+                            <property name="icon_name">mail-attachment-symbolic</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="conversation_attach_original_button">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="focus_on_click">False</property>
+                        <property name="receives_default">False</property>
+                        <property name="tooltip_text" translatable="yes">Add original attachments</property>
+                        <property name="action_name">win.add-original-attachments</property>
+                        <property name="always_show_image">True</property>
+                        <child>
+                          <object class="GtkImage" id="conversation_attach_original_image">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="pixel_size">16</property>
+                            <property name="icon_name">edit-copy-symbolic</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <style>
+                      <class name="linked"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
                 <child type="center">
                   <object class="GtkLabel" id="info_label">
                     <property name="visible">True</property>
@@ -1073,6 +1156,8 @@
                     <property name="focus_on_click">False</property>
                     <property name="receives_default">False</property>
                     <property name="menu_model">rich_text_menu</property>
+                    <property name="tooltip_text" translatable="yes">Enable or disable rich text 
mode</property>
+                    <property name="direction">up</property>
                     <child>
                       <object class="GtkImage">
                         <property name="visible">True</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]