[gnome-clocks/zbrown/list-alarms: 53/59] alarms: update ringing state



commit 689ad9e381ff9b2a096f9effcbae9ae40cc5ca86
Author: Zander Brown <zbrown gnome org>
Date:   Thu Jan 16 01:37:17 2020 +0000

    alarms: update ringing state
    
    Now clearly shows the title of the alarm

 data/css/gnome-clocks.css |  7 ++++-
 data/ui/alarmringing.ui   | 71 ++++++++++++++++++++++++++++++++++-------------
 src/alarm.vala            |  8 +++++-
 3 files changed, 65 insertions(+), 21 deletions(-)
---
diff --git a/data/css/gnome-clocks.css b/data/css/gnome-clocks.css
index f8ad06e..0ce3550 100644
--- a/data/css/gnome-clocks.css
+++ b/data/css/gnome-clocks.css
@@ -88,7 +88,12 @@ row.snoozing {
 
 .clocks-standalone-label,
 .clocks-ringing-label {
-    font-size: 64pt;
+    font-size: 6em;
+}
+
+.clocks-ringing-title {
+    font-size: 1.5em;
+    font-weight: bold;
 }
 
 .clocks-secondary-standalone-label {
diff --git a/data/ui/alarmringing.ui b/data/ui/alarmringing.ui
index d889110..65d384e 100644
--- a/data/ui/alarmringing.ui
+++ b/data/ui/alarmringing.ui
@@ -5,29 +5,14 @@
   <template class="ClocksAlarmRingingPanel" parent="GtkGrid">
     <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_top">6</property>
+    <property name="margin_bottom">6</property>
     <property name="hexpand">True</property>
     <property name="vexpand">True</property>
     <property name="row_spacing">48</property>
     <property name="column_spacing">24</property>
-    <child>
-      <object class="GtkLabel" id="time_label">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="halign">center</property>
-        <property name="valign">center</property>
-        <property name="justify">center</property>
-        <property name="wrap">True</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
-        <style>
-          <class name="clocks-ringing-label"/>
-        </style>
-      </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">0</property>
-      </packing>
-    </child>
     <child>
       <object class="GtkGrid" id="button_grid">
         <property name="visible">True</property>
@@ -82,5 +67,53 @@
         <property name="top_attach">1</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="halign">center</property>
+        <property name="valign">center</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">True</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="title_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="justify">center</property>
+            <property name="wrap">True</property>
+            <style>
+              <class name="clocks-ringing-title"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="time_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="justify">center</property>
+            <property name="wrap">True</property>
+            <property name="xalign">0.5</property>
+            <style>
+              <class name="clocks-ringing-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">0</property>
+      </packing>
+    </child>
   </template>
 </interface>
diff --git a/src/alarm.vala b/src/alarm.vala
index f70562e..6ca9643 100644
--- a/src/alarm.vala
+++ b/src/alarm.vala
@@ -724,6 +724,8 @@ private class RingingPanel : Gtk.Grid {
     private Item? _alarm;
     private ulong alarm_state_handler;
     [GtkChild]
+    private Gtk.Label title_label;
+    [GtkChild]
     private Gtk.Label time_label;
 
     [GtkCallback]
@@ -747,11 +749,15 @@ private class RingingPanel : Gtk.Grid {
 
     public void update () {
         if (alarm != null) {
+            title_label.label = alarm.name;
             if (alarm.state == Item.State.SNOOZING) {
                 time_label.label = alarm.snooze_time_label;
             } else {
                 time_label.label = alarm.time_label;
             }
+        } else {
+            title_label.label = "";
+            time_label.label = "";
         }
     }
 }
@@ -892,7 +898,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
         ringing_panel.alarm = alarm;
         ringing_panel.update ();
         visible_child = ringing_panel;
-        title = ringing_panel.alarm.name;
+        title = _("Alarm");
         view_mode = STANDALONE;
         button_mode = NONE;
     }


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