[gnome-contacts/editor] contact-editor: imporve grid spacing



commit 990e5d0110696155b614080d6f5e06544c578c4b
Author: Julian Sparber <julian sparber net>
Date:   Tue Jun 25 15:21:33 2019 +0200

    contact-editor: imporve grid spacing
    
    Reduce grid size to 3 for instead of 4, this caused to much space
    between the input field and the delete button.
    
    Reduce margins around grid to the same values as g-c-c and reduce
    general spacing

 data/ui/contacts-contact-form.ui |  8 +++++---
 src/contacts-contact-editor.vala | 16 ++++++++--------
 2 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/data/ui/contacts-contact-form.ui b/data/ui/contacts-contact-form.ui
index b0c1fd1..b1b057a 100644
--- a/data/ui/contacts-contact-form.ui
+++ b/data/ui/contacts-contact-form.ui
@@ -15,6 +15,7 @@
           <object class="ContactsMaxWidthBin">
             <property name="visible">True</property>
             <property name="max_width">600</property>
+            <property name="halign">center</property>
             <child>
               <object class="GtkGrid" id="container_grid">
                 <property name="visible">True</property>
@@ -22,9 +23,10 @@
                 <property name="vexpand">True</property>
                 <property name="orientation">vertical</property>
                 <property name="row_spacing">12</property>
-                <property name="column_spacing">16</property>
-                <property name="margin">36</property>
-                <property name="margin_bottom">24</property>
+                <property name="column_spacing">12</property>
+                <property name="margin">12</property>
+                <property name="margin_top">36</property>
+                <property name="margin_bottom">36</property>
               </object>
             </child>
           </object>
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index 3398bf0..73bafe1 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -351,7 +351,7 @@ public class Contacts.ContactEditor : ContactForm {
            child.destroy ();
            child = container_grid.get_child_at (1, row);
            child.destroy ();
-           child = container_grid.get_child_at (3, row);
+           child = container_grid.get_child_at (2, row);
            child.destroy ();
 
            field_entry.value.changed = true;
@@ -385,7 +385,7 @@ public class Contacts.ContactEditor : ContactForm {
 
     var delete_button = new Button.from_icon_name ("user-trash-symbolic", IconSize.MENU);
     delete_button.get_accessible ().set_name (_("Delete field"));
-    container_grid.attach (delete_button, 3, row, 1, 1);
+    container_grid.attach (delete_button, 2, row, 1, 1);
 
     /* Notify change to upper layer */
     combo.changed.connect ((c) => {
@@ -416,7 +416,7 @@ public class Contacts.ContactEditor : ContactForm {
 
     var delete_button = new Button.from_icon_name ("user-trash-symbolic", IconSize.MENU);
     delete_button.get_accessible ().set_name (_("Delete field"));
-    container_grid.attach (delete_button, 3, row, 1, 1);
+    container_grid.attach (delete_button, 2, row, 1, 1);
 
     /* Notify change to upper layer */
     value_entry.changed.connect (() => {
@@ -451,7 +451,7 @@ public class Contacts.ContactEditor : ContactForm {
     var delete_button = new Button.from_icon_name ("user-trash-symbolic", IconSize.MENU);
     delete_button.get_accessible ().set_name (_("Delete field"));
     delete_button.set_valign (Align.START);
-    container_grid.attach (delete_button, 3, row, 1, 1);
+    container_grid.attach (delete_button, 2, row, 1, 1);
 
     /* Notify change to upper layer */
     value_text.get_buffer ().changed.connect (() => {
@@ -505,7 +505,7 @@ public class Contacts.ContactEditor : ContactForm {
 
     var delete_button = new Button.from_icon_name ("user-trash-symbolic", IconSize.MENU);
     delete_button.get_accessible ().set_name (_("Delete field"));
-    container_grid.attach (delete_button, 3, row, 1, 1);
+    container_grid.attach (delete_button, 2, row, 1, 1);
 
     AdjustingDateFn fn = () => {
       int[] month_of_31 = {3, 5, 8, 10};
@@ -556,7 +556,7 @@ public class Contacts.ContactEditor : ContactForm {
     var delete_button = new Button.from_icon_name ("user-trash-symbolic", IconSize.MENU);
     delete_button.get_accessible ().set_name (_("Delete field"));
     delete_button.set_valign (Align.START);
-    container_grid.attach (delete_button, 3, row, 1, 1);
+    container_grid.attach (delete_button, 2, row, 1, 1);
 
     /* Notify change to upper layer */
     combo.changed.connect (() => {
@@ -678,7 +678,7 @@ public class Contacts.ContactEditor : ContactForm {
       }
       if (! rows.is_empty) {
        has_nickname_row = true;
-       var delete_button = container_grid.get_child_at (3, row - 1) as Button;
+       var delete_button = container_grid.get_child_at (2, row - 1) as Button;
        delete_button.clicked.connect (() => {
            has_nickname_row = false;
          });
@@ -959,7 +959,7 @@ public class Contacts.ContactEditor : ContactForm {
         this.name_entry.set_data ("changed", true);
       });
 
-    this.container_grid.attach (this.name_entry, 1, 0, 3, 3);
+    this.container_grid.attach (this.name_entry, 1, 0, 2, 3);
   }
 
   public bool name_changed () {


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