[geary/mjog/mail-merge-plugin: 51/71] Composer.Widget: Place composer action bars into their own container




commit f0b1362f4ff892fc3e7f66684947dfc6812fc092
Author: Michael Gratton <mike vee net>
Date:   Tue Jul 7 16:25:05 2020 +1000

    Composer.Widget: Place composer action bars into their own container
    
    Use CSS instead of widget props to ensure widgets have sufficient
    white space.
    
    This will allow adding additional action bars (e.g. by plugins) in a
    more straight-forward manner.

 src/client/composer/composer-widget.vala |  6 ++----
 ui/composer-widget.ui                    | 25 +++++++++++++++++--------
 ui/geary.css                             |  8 ++++++++
 3 files changed, 27 insertions(+), 12 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index ba796f5e7..bf076597f 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -407,6 +407,8 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
     [GtkChild]
     private Gtk.Label message_overlay_label;
     [GtkChild]
+    private Gtk.Box action_bar_box;
+    [GtkChild]
     private Gtk.Box attachments_box;
     [GtkChild]
     private Gtk.Box hidden_on_attachment_drag_over;
@@ -1939,8 +1941,6 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
         wrapper_box.pack_start(new Gtk.Separator(HORIZONTAL));
 
         Gtk.Box box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6);
-        box.margin_top = 6;
-        box.margin_bottom = 6;
         wrapper_box.pack_start(box);
 
         /// In the composer, the filename followed by its filesize, i.e. "notes.txt (1.12KB)"
@@ -1949,8 +1949,6 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
         Gtk.Label label = new Gtk.Label(label_text);
         box.pack_start(label);
         label.halign = Gtk.Align.START;
-        label.margin_start = 4;
-        label.margin_end = 4;
 
         Gtk.Button remove_button = new Gtk.Button.from_icon_name("user-trash-symbolic", BUTTON);
         box.pack_start(remove_button, false, false);
diff --git a/ui/composer-widget.ui b/ui/composer-widget.ui
index bad90d35d..cf57b42c5 100644
--- a/ui/composer-widget.ui
+++ b/ui/composer-widget.ui
@@ -575,6 +575,18 @@
                 </style>
               </object>
             </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="action_bar_box">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="orientation">vertical</property>
             <child>
               <object class="GtkRevealer" id="formatting">
                 <property name="visible">True</property>
@@ -1219,28 +1231,25 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">3</property>
+            <property name="position">4</property>
           </packing>
         </child>
         <child>
           <object class="GtkBox" id="attachments_box">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="margin_left">6</property>
-            <property name="margin_right">6</property>
-            <property name="margin_start">6</property>
-            <property name="margin_end">6</property>
-            <property name="margin_top">0</property>
-            <property name="margin_bottom">3</property>
             <property name="orientation">vertical</property>
             <child>
               <placeholder/>
             </child>
+            <style>
+              <class name="geary-attachments-box"/>
+            </style>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">4</property>
+            <property name="position">5</property>
           </packing>
         </child>
       </object>
diff --git a/ui/geary.css b/ui/geary.css
index 355882e62..0ddfab309 100644
--- a/ui/geary.css
+++ b/ui/geary.css
@@ -191,6 +191,14 @@ grid.geary-message-summary {
   border-radius: 0px;
 }
 
+.geary-attachments-box > box > box {
+  margin: 6px;
+}
+
+.geary-attachments-box > box > box > label {
+  margin: 0px 4px;
+}
+
 /* AttachmentPane  */
 
 .geary-attachment-pane flowbox {


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