[gnome-clocks] location-dialog: Port to Box



commit a7a8bbb0132a2df7b50993f3303f99103244acde
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Mon Dec 13 15:27:51 2021 +0100

    location-dialog: Port to Box
    
    And fix visual nits.

 data/ui/world-location-dialog-row.ui | 83 ++++++++++++++++--------------------
 data/ui/world-location-dialog.ui     |  2 +
 src/world-location-dialog.vala       |  1 -
 3 files changed, 39 insertions(+), 47 deletions(-)
---
diff --git a/data/ui/world-location-dialog-row.ui b/data/ui/world-location-dialog-row.ui
index f67c0734..32219984 100644
--- a/data/ui/world-location-dialog-row.ui
+++ b/data/ui/world-location-dialog-row.ui
@@ -3,73 +3,64 @@
   <template class="ClocksWorldLocationDialogRow" parent="GtkListBoxRow">
     <property name="selectable">False</property>
     <child>
-      <object class="GtkGrid">
-        <property name="valign">start</property>
-        <property name="margin">12</property>
-        <property name="hexpand">True</property>
-        <property name="row_spacing">6</property>
-        <property name="column_spacing">12</property>
-        <child>
-          <object class="GtkLabel">
-            <property name="hexpand">True</property>
-            <property name="label" bind-source="ClocksWorldLocationDialogRow" 
bind-property="clock-description" bind-flags="sync-create"/>
-            <property name="ellipsize">end</property>
-            <property name="xalign">0</property>
-            <property name="yalign">0</property>
-            <style>
-              <class name="dim-label"/>
-              <class name="clock-desc"/>
-            </style>
-            <layout>
-              <property name="column">0</property>
-              <property name="row">1</property>
-            </layout>
-          </object>
-        </child>
+      <object class="GtkBox">
+        <property name="margin-top">12</property>
+        <property name="margin-bottom">12</property>
+        <property name="margin-start">12</property>
+        <property name="margin-end">12</property>
         <child>
           <object class="GtkBox">
-            <property name="spacing">10</property>
+            <property name="orientation">vertical</property>
+            <property name="hexpand">True</property>
+            <property name="spacing">6</property>
             <child>
-              <object class="GtkLabel">
-                <property name="label" bind-source="ClocksWorldLocationDialogRow" bind-property="clock-name" 
bind-flags="sync-create"/>
-                <property name="ellipsize">end</property>
-                <property name="xalign">0</property>
-                <property name="yalign">1</property>
-                <style>
-                  <class name="clock-title"/>
-                </style>
+              <object class="GtkBox">
+                <property name="spacing">10</property>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="label" bind-source="ClocksWorldLocationDialogRow" 
bind-property="clock-name" bind-flags="sync-create"/>
+                    <property name="ellipsize">end</property>
+                    <property name="xalign">0</property>
+                    <property name="yalign">1</property>
+                    <style>
+                      <class name="title"/>
+                    </style>
+                  </object>
+                </child>
+                <child>
+                  <object class="GtkLabel">
+                    <property name="label" bind-source="ClocksWorldLocationDialogRow" 
bind-property="clock-location" bind-flags="sync-create"/>
+                    <property name="xalign">0</property>
+                    <property name="yalign">1</property>
+                    <style>
+                      <class name="heading"/>
+                    </style>
+                  </object>
+                </child>
               </object>
             </child>
             <child>
               <object class="GtkLabel">
-                <property name="label" bind-source="ClocksWorldLocationDialogRow" 
bind-property="clock-location" bind-flags="sync-create"/>
+                <property name="hexpand">True</property>
+                <property name="label" bind-source="ClocksWorldLocationDialogRow" 
bind-property="clock-description" bind-flags="sync-create"/>
+                <property name="ellipsize">end</property>
                 <property name="xalign">0</property>
-                <property name="yalign">1</property>
+                <property name="yalign">0</property>
                 <style>
-                  <class name="clock-location"/>
+                  <class name="dim-label"/>
+                  <class name="caption"/>
                 </style>
               </object>
             </child>
-            <layout>
-              <property name="column">0</property>
-              <property name="row">0</property>
-            </layout>
           </object>
         </child>
         <child>
           <object class="GtkImage">
             <property name="visible" bind-source="ClocksWorldLocationDialogRow" 
bind-property="clock-selected" bind-flags="sync-create"/>
             <property name="icon_name">object-select-symbolic</property>
-            <layout>
-              <property name="column">2</property>
-              <property name="row">0</property>
-            </layout>
           </object>
         </child>
       </object>
     </child>
-    <style>
-      <class name="clock"/>
-    </style>
   </template>
 </interface>
diff --git a/data/ui/world-location-dialog.ui b/data/ui/world-location-dialog.ui
index ea3695d5..c9b28d04 100644
--- a/data/ui/world-location-dialog.ui
+++ b/data/ui/world-location-dialog.ui
@@ -38,6 +38,8 @@
         <child>
           <object class="AdwClamp">
             <property name="width_request">300</property>
+            <property name="margin-start">12</property>
+            <property name="margin-end">12</property>
             <child>
               <object class="GtkBox">
                 <property name="orientation">vertical</property>
diff --git a/src/world-location-dialog.vala b/src/world-location-dialog.vala
index 6ec88fd7..fa22280b 100644
--- a/src/world-location-dialog.vala
+++ b/src/world-location-dialog.vala
@@ -127,7 +127,6 @@ private class LocationDialog : Gtk.Window {
 
     [GtkCallback]
     private void add_button_clicked () {
-        // emit ("location-added");
         location_added ();
         close ();
     }


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