[gnome-clocks/zbrown/list-alarms: 9/23] alarms: Open dialog instead of toggling



commit a8b824b9d3792c08c898ee217eb5c6351ae1168e
Author: Zander Brown <zbrown gnome org>
Date:   Tue Aug 6 20:22:51 2019 +0100

    alarms: Open dialog instead of toggling

 data/ui/alarmtile.ui | 18 +-----------------
 src/alarm.vala       |  9 ++++-----
 2 files changed, 5 insertions(+), 22 deletions(-)
---
diff --git a/data/ui/alarmtile.ui b/data/ui/alarmtile.ui
index 9e6578a..4b0192b 100644
--- a/data/ui/alarmtile.ui
+++ b/data/ui/alarmtile.ui
@@ -3,20 +3,11 @@
   <template class="ClocksAlarmRow" parent="HdyActionRow">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
-    <property name="activatable-widget">toggle</property>
     <child type="action">
-      <object class="GtkButton">
+      <object class="GtkSwitch" id="toggle">
         <property name="visible">True</property>
         <property name="valign">center</property>
         <property name="halign">center</property>
-        <signal name="clicked" handler="edit" swapped="no" object="ClocksAlarmRow"/>
-        <child>
-          <object class="GtkImage">
-            <property name="visible">True</property>
-            <property name="icon-name">applications-system-symbolic</property>
-            <property name="icon-size">4</property>
-          </object>
-        </child>
       </object>
     </child>
     <child type="action">
@@ -28,12 +19,5 @@
         <property name="margin-bottom">8</property>
       </object>
     </child>
-    <child type="action">
-      <object class="GtkSwitch" id="toggle">
-        <property name="visible">True</property>
-        <property name="valign">center</property>
-        <property name="halign">center</property>
-      </object>
-    </child>
   </template>
 </interface>
diff --git a/src/alarm.vala b/src/alarm.vala
index a8b3f28..efbf43c 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -296,6 +296,10 @@ private class Row : Hdy.ActionRow {
         update ();
     }
 
+    public override void activate () {
+        face.edit(alarm);
+    }
+
     private void update () {
         string text, sub_text;
 
@@ -321,11 +325,6 @@ private class Row : Hdy.ActionRow {
             title = text;
         }
     }
-
-    [GtkCallback]
-    private void edit () requires (face != null && alarm != null) {
-        face.edit(alarm);
-    }
 }
 
 [GtkTemplate (ui = "/org/gnome/clocks/ui/alarmsetupdialog.ui")]


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