[gnome-control-center/wip/rhughes/night-light-v5] display: Use the latest mockups for the night light functionality



commit 8fb03a5ce43d02342da53b9021a35c135ebcafb8
Author: Richard Hughes <richard hughsie com>
Date:   Wed Feb 15 13:30:31 2017 +0000

    display: Use the latest mockups for the night light functionality

 panels/display/cc-night-light-dialog.c |   28 ++-
 panels/display/cc-night-light-widget.c |  125 ++++++---
 panels/display/display.ui              |  481 +++++++++++++++++---------------
 3 files changed, 345 insertions(+), 289 deletions(-)
---
diff --git a/panels/display/cc-night-light-dialog.c b/panels/display/cc-night-light-dialog.c
index 66117ed..dfd44c9 100644
--- a/panels/display/cc-night-light-dialog.c
+++ b/panels/display/cc-night-light-dialog.c
@@ -181,12 +181,17 @@ dialog_update_state (CcNightLightDialog *self)
   gtk_widget_set_visible (widget, disabled_until_tomorrow);
 
   /* make things insensitive if the switch is disabled */
-  enabled = g_settings_get_boolean (self->settings_display, "night-light-enabled");
-  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "radio_automatic"));
+  enabled = g_settings_get_boolean (self->settings_display,
+                                    "night-light-enabled");
+  automatic = g_settings_get_boolean (self->settings_display,
+                                      "night-light-schedule-automatic");
+  gtk_widget_set_sensitive (self->night_light_widget, enabled);
+  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "togglebutton_automatic"));
   gtk_widget_set_sensitive (widget, enabled);
-  automatic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "radio_manual"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), automatic);
+  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "togglebutton_manual"));
   gtk_widget_set_sensitive (widget, enabled);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), !automatic);
   widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "box_manual"));
   gtk_widget_set_sensitive (widget, enabled && !automatic);
 
@@ -270,12 +275,13 @@ dialog_enabled_notify_cb (GtkSwitch *sw, GParamSpec *pspec, CcNightLightDialog *
 static void
 dialog_mode_changed_cb (GtkToggleButton *togglebutton, CcNightLightDialog *self)
 {
-  GtkWidget *widget;
   gboolean ret;
 
-  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "radio_automatic"));
-  ret = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-  g_settings_set_boolean (self->settings_display, "night-light-schedule-automatic", ret);
+  if (!gtk_toggle_button_get_active (togglebutton))
+    return;
+
+  ret = g_settings_get_boolean (self->settings_display, "night-light-schedule-automatic");
+  g_settings_set_boolean (self->settings_display, "night-light-schedule-automatic", !ret);
 }
 
 static void
@@ -583,10 +589,10 @@ cc_night_light_dialog_init (CcNightLightDialog *self)
   g_settings_bind_writable (self->settings_display, "night-light-enabled",
                             sw, "sensitive",
                             FALSE);
-  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "radio_automatic"));
+  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "togglebutton_automatic"));
   g_signal_connect (widget, "toggled",
                     G_CALLBACK (dialog_mode_changed_cb), self);
-  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "radio_manual"));
+  widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "togglebutton_manual"));
   g_signal_connect (widget, "toggled",
                     G_CALLBACK (dialog_mode_changed_cb), self);
   adj = GTK_ADJUSTMENT (gtk_builder_get_object (self->builder, "adjustment_from_hours"));
@@ -657,7 +663,7 @@ cc_night_light_dialog_init (CcNightLightDialog *self)
 
   /* add custom widget */
   self->night_light_widget = cc_night_light_widget_new ();
-  gtk_widget_set_size_request (self->night_light_widget, -1, 34);
+  gtk_widget_set_size_request (self->night_light_widget, -1, 40);
   box = GTK_BOX (gtk_builder_get_object (self->builder, "box_content"));
   gtk_box_pack_start (box, self->night_light_widget, FALSE, FALSE, 0);
   gtk_widget_show (self->night_light_widget);
diff --git a/panels/display/cc-night-light-widget.c b/panels/display/cc-night-light-widget.c
index a7e646f..5243444 100644
--- a/panels/display/cc-night-light-widget.c
+++ b/panels/display/cc-night-light-widget.c
@@ -192,8 +192,10 @@ cc_night_light_widget_draw (GtkWidget *widget, cairo_t *cr)
   GtkAllocation rect;
   const guint arrow_sz = 5; /* px */
   const guint icon_sz = 16; /* px */
+  const guint pad_upper_sz = 6; /* px */
+  const guint pad_lower_sz = 4; /* px */
   guint line_x = 0; /* px */
-  const guint bar_voffset = arrow_sz + icon_sz;
+  guint bar_sz;
 
   CcNightLightWidget *self = (CcNightLightWidget*) widget;
   g_return_val_if_fail (self != NULL, FALSE);
@@ -202,74 +204,104 @@ cc_night_light_widget_draw (GtkWidget *widget, cairo_t *cr)
   cd_color_rgb_set (&color_temperature, 0.992, 0.796, 0.612);
   cd_color_rgb_set (&color_unity, 0.773, 0.862, 0.953);
 
+  /*
+   *      /
+   *      |  icon_sz
+   *      \
+   *            <- pad_upper_sz
+   *      /
+   *      |  bar_sz (calculated)
+   *      \
+   *            <- pad_lower_sz
+   *      /
+   *      |  arrow_sz
+   *      \
+   */
   gtk_widget_get_allocation (widget, &rect);
+  bar_sz = rect.height - (icon_sz + pad_upper_sz + pad_lower_sz + arrow_sz);
 
   /* clip to a rounded rectangle */
   cairo_save (cr);
   cairo_set_line_width (cr, 1);
-  rounded_rectangle (cr, 0, bar_voffset, 6,
-                     rect.width, rect.height - bar_voffset - 1);
+  rounded_rectangle (cr, 0, icon_sz + pad_upper_sz, 6,
+                     rect.width, bar_sz);
   cairo_clip (cr);
 
   /* draw each color line */
-  cairo_set_line_width (cr, 1);
   gdouble subsect = 24.f / (gdouble) rect.width;
-  for (guint x = 0; x < rect.width; x += 1)
+  if (gtk_widget_is_sensitive (widget))
     {
-      gdouble frac_hour = subsect * x;
-      if (frac_hour > self->now && line_x == 0)
-        {
-          cd_color_rgb_set (&color, 0.333, 0.333, 0.333);
-          line_x = x;
-        }
-      else if (is_frac_day_between (frac_hour, self->to - 1, self->to))
-        {
-          gdouble frac = 1.f - (self->to - frac_hour);
-          cd_color_rgb_interpolate (&color_temperature,
-                                    &color_unity,
-                                    frac,
-                                    &color);
-        }
-      else if (is_frac_day_between (frac_hour, self->from - 1, self->from))
-        {
-          gdouble frac = self->from - frac_hour;
-          cd_color_rgb_interpolate (&color_temperature,
-                                    &color_unity,
-                                    frac,
-                                    &color);
-        }
-      else if (is_frac_day_between (frac_hour, self->to, self->from))
-        {
-          cd_color_rgb_copy (&color_unity, &color);
-        }
-      else
+      cairo_set_line_width (cr, 1);
+      for (guint x = 0; x < rect.width; x += 1)
         {
-          cd_color_rgb_copy (&color_temperature, &color);
+          gdouble frac_hour = subsect * x;
+          if (is_frac_day_between (frac_hour, self->to - 1, self->to))
+            {
+              gdouble frac = 1.f - (self->to - frac_hour);
+              cd_color_rgb_interpolate (&color_temperature,
+                                        &color_unity,
+                                        frac,
+                                        &color);
+            }
+          else if (is_frac_day_between (frac_hour, self->from - 1, self->from))
+            {
+              gdouble frac = self->from - frac_hour;
+              cd_color_rgb_interpolate (&color_temperature,
+                                        &color_unity,
+                                        frac,
+                                        &color);
+            }
+          else if (is_frac_day_between (frac_hour, self->to, self->from))
+            {
+              cd_color_rgb_copy (&color_unity, &color);
+            }
+          else
+            {
+              cd_color_rgb_copy (&color_temperature, &color);
+            }
+          cairo_set_source_rgb (cr, color.R, color.G, color.B);
+          cairo_move_to (cr, x + 0.5, icon_sz + pad_upper_sz);
+          cairo_line_to (cr, x + 0.5, icon_sz + pad_upper_sz + bar_sz);
+          cairo_stroke (cr);
         }
-      cairo_set_source_rgb (cr, color.R, color.G, color.B);
-      cairo_move_to (cr, x + 0.5, bar_voffset);
-      cairo_line_to (cr, x + 0.5, bar_voffset + rect.height);
-      cairo_stroke (cr);
+    }
+  else
+    {
+      rounded_rectangle (cr, 0, icon_sz + pad_upper_sz, 6,
+                         rect.width, bar_sz);
+      cairo_set_source_rgb (cr, 0.95f, 0.95f, 0.95f);
+      cairo_fill (cr);
     }
 
   /* apply border */
-  rounded_rectangle (cr, 0, bar_voffset, 6,
-                     rect.width, rect.height - bar_voffset - 1);
+  rounded_rectangle (cr, 0, icon_sz + pad_upper_sz, 6,
+                     rect.width, bar_sz);
   cairo_set_source_rgb (cr, 0.65, 0.65, 0.65);
   cairo_set_line_width (cr, 1);
   cairo_stroke (cr);
   cairo_restore (cr);
 
   /* apply arrow */
-  cairo_move_to (cr, line_x - arrow_sz + 0.5, bar_voffset - arrow_sz);
-  cairo_line_to (cr, line_x + arrow_sz + 0.5, bar_voffset - arrow_sz);
-  cairo_line_to (cr, line_x + 0.5, arrow_sz + bar_voffset - arrow_sz);
-  cairo_close_path (cr);
-  cairo_set_source_rgb (cr, 0.333, 0.333, 0.333);
-  cairo_fill (cr);
+  if (gtk_widget_is_sensitive (widget))
+    {
+      line_x = self->now / subsect;
+      cairo_move_to (cr,
+                     line_x - arrow_sz + 0.5,
+                     icon_sz + pad_upper_sz + bar_sz + pad_lower_sz + arrow_sz);
+      cairo_line_to (cr,
+                     line_x + arrow_sz + 0.5,
+                     icon_sz + pad_upper_sz + bar_sz + pad_lower_sz + arrow_sz);
+      cairo_line_to (cr,
+                     line_x + 0.5,
+                     icon_sz + pad_upper_sz + bar_sz + pad_lower_sz);
+      cairo_close_path (cr);
+      cairo_set_source_rgb (cr, 0.333, 0.333, 0.333);
+      cairo_fill (cr);
+    }
 
   /* draw icons */
-  if (self->mode == CC_NIGHT_LIGHT_WIDGET_MODE_AUTOMATIC)
+  if (gtk_widget_is_sensitive (widget) &&
+      self->mode == CC_NIGHT_LIGHT_WIDGET_MODE_AUTOMATIC)
     {
       if (self->to <= 0)
         line_x = rect.width - icon_sz;
@@ -284,6 +316,7 @@ cc_night_light_widget_draw (GtkWidget *widget, cairo_t *cr)
       cairo_set_source_surface (cr, self->surface_sunset, line_x, 0);
       cairo_paint (cr);
     }
+
   return FALSE;
 }
 
diff --git a/panels/display/display.ui b/panels/display/display.ui
index ff2a74e..cb649c7 100644
--- a/panels/display/display.ui
+++ b/panels/display/display.ui
@@ -133,78 +133,116 @@
                 <property name="orientation">vertical</property>
                 <property name="spacing">22</property>
                 <child>
-                  <object class="GtkBox">
+                  <object class="GtkLabel">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="halign">start</property>
+                    <property name="valign">start</property>
+                    <property name="margin_bottom">10</property>
+                    <property name="label" translatable="yes">Night light makes the screen color warmer. 
This can help to prevent eye strain and sleeplessness.</property>
+                    <property name="wrap">True</property>
+                    <property name="max_width_chars">60</property>
+                    <property name="xalign">0</property>
+                    <style>
+                      <class name="dim-label"/>
+                    </style>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkGrid">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="margin_bottom">14</property>
+                    <property name="margin_bottom">16</property>
+                    <property name="hexpand">True</property>
+                    <property name="row_spacing">22</property>
+                    <property name="column_spacing">60</property>
                     <child>
                       <object class="GtkLabel">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="hexpand">True</property>
                         <property name="label" translatable="yes">Night Light</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkSwitch" id="switch_enable">
+                      <object class="GtkLabel">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="hexpand">True</property>
+                        <property name="label" translatable="yes">Schedule</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="pack_type">end</property>
-                        <property name="position">1</property>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkBox">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="spacing">42</property>
                     <child>
-                      <object class="GtkRadioButton" id="radio_automatic">
-                        <property name="label" translatable="yes" comments="When the sun comes up in the 
morning to the time the sun goes down in the evening">Sunset to sunrise</property>
+                      <object class="GtkSwitch" id="switch_enable">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="active">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">radio_manual</property>
+                        <property name="halign">start</property>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkRadioButton" id="radio_manual">
-                        <property name="label" translatable="yes" comments="This allows the user to schedule 
when the redshift functionality is triggered">Manual schedule</property>
+                      <object class="GtkButtonBox">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="active">True</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="layout_style">end</property>
+                        <child>
+                          <object class="GtkToggleButton" id="togglebutton_automatic">
+                            <property name="label" translatable="yes">Sunset to Sunrise</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="active">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkToggleButton" id="togglebutton_manual">
+                            <property name="label" translatable="yes">Manual</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <style>
+                          <class name="linked"/>
+                        </style>
                       </object>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                   </object>
@@ -218,304 +256,283 @@
                   <object class="GtkBox" id="box_manual">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">42</property>
+                    <property name="spacing">18</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="valign">start</property>
+                        <property name="label" translatable="yes">From</property>
+                        <style>
+                          <class name="dim-label"/>
+                        </style>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
                     <child>
                       <object class="GtkBox">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">12</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="spinbutton_from_hours">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="max_width_chars">2</property>
+                            <property name="text" translatable="yes">4</property>
+                            <property name="orientation">vertical</property>
+                            <property name="adjustment">adjustment_from_hours</property>
+                            <property name="numeric">True</property>
+                            <property name="wrap">True</property>
+                            <property name="value">4</property>
+                            <style>
+                              <class name="padded-spinbutton"/>
+                            </style>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
                         <child>
                           <object class="GtkLabel">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="halign">start</property>
-                            <property name="label" translatable="yes">From</property>
+                            <property name="label" translatable="yes">:</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="spinbutton_from_minutes">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="max_width_chars">2</property>
+                            <property name="text" translatable="yes">0</property>
+                            <property name="orientation">vertical</property>
+                            <property name="adjustment">adjustment_from_minutes</property>
+                            <property name="numeric">True</property>
+                            <property name="wrap">True</property>
                             <style>
-                              <class name="dim-label"/>
+                              <class name="padded-spinbutton"/>
                             </style>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
+                            <property name="fill">True</property>
+                            <property name="position">2</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkStack" id="stack_from">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
                             <child>
-                              <object class="GtkSpinButton" id="spinbutton_from_hours">
+                              <object class="GtkButton" id="button_from_am">
+                                <property name="label" translatable="yes" comments="This is the short form 
for the time period in the morning">AM</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="max_width_chars">2</property>
-                                <property name="orientation">vertical</property>
-                                <property name="adjustment">adjustment_from_hours</property>
-                                <property name="numeric">True</property>
-                                <property name="wrap">True</property>
-                                <property name="value">4</property>
+                                <property name="receives_default">True</property>
+                                <property name="valign">center</property>
                                 <style>
-                                  <class name="padded-spinbutton"/>
+                                  <class name="unpadded-button"/>
                                 </style>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
+                                <property name="name">am</property>
+                                <property name="title" translatable="yes">page0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">:</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkSpinButton" id="spinbutton_from_minutes">
+                              <object class="GtkButton" id="button_from_pm">
+                                <property name="label" translatable="yes" comments="This is the short form 
for the time period in the afternoon">PM</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="max_width_chars">2</property>
-                                <property name="orientation">vertical</property>
-                                <property name="adjustment">adjustment_from_minutes</property>
-                                <property name="numeric">True</property>
-                                <property name="wrap">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="valign">center</property>
                                 <style>
-                                  <class name="padded-spinbutton"/>
+                                  <class name="unpadded-button"/>
                                 </style>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
+                                <property name="name">pm</property>
+                                <property name="title" translatable="yes">page1</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkStack" id="stack_from">
+                              <object class="GtkLabel">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="margin_left">6</property>
-                                <child>
-                                  <object class="GtkButton" id="button_from_am">
-                                    <property name="label" translatable="yes" comments="This is the short 
form for the time period in the morning">AM</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="valign">center</property>
-                                    <style>
-                                      <class name="unpadded-button"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="name">am</property>
-                                    <property name="title">page0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="button_from_pm">
-                                    <property name="label" translatable="yes" comments="This is the short 
form for the time period in the afternoon">PM</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="valign">center</property>
-                                    <style>
-                                      <class name="unpadded-button"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="name">pm</property>
-                                    <property name="title">page1</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                  </object>
-                                  <packing>
-                                    <property name="name">blank</property>
-                                    <property name="title">page0</property>
-                                    <property name="position">2</property>
-                                  </packing>
-                                </child>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">3</property>
+                                <property name="name">blank</property>
+                                <property name="title" translatable="yes">page0</property>
+                                <property name="position">2</property>
                               </packing>
                             </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">1</property>
+                            <property name="position">3</property>
                           </packing>
                         </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">0</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkBox">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="orientation">vertical</property>
-                        <property name="spacing">12</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="spinbutton_to_hours">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="max_width_chars">2</property>
+                            <property name="text" translatable="yes">4</property>
+                            <property name="input_purpose">number</property>
+                            <property name="orientation">vertical</property>
+                            <property name="adjustment">adjustment_to_hours</property>
+                            <property name="numeric">True</property>
+                            <property name="wrap">True</property>
+                            <property name="value">4</property>
+                            <style>
+                              <class name="padded-spinbutton"/>
+                            </style>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
                         <child>
                           <object class="GtkLabel">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="halign">start</property>
-                            <property name="label" translatable="yes">To</property>
+                            <property name="label" translatable="yes">:</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkSpinButton" id="spinbutton_to_minutes">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="max_width_chars">2</property>
+                            <property name="text" translatable="yes">0</property>
+                            <property name="orientation">vertical</property>
+                            <property name="adjustment">adjustment_to_minutes</property>
+                            <property name="numeric">True</property>
+                            <property name="wrap">True</property>
                             <style>
-                              <class name="dim-label"/>
+                              <class name="padded-spinbutton"/>
                             </style>
                           </object>
                           <packing>
                             <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
+                            <property name="fill">True</property>
+                            <property name="position">2</property>
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkStack" id="stack_to">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
                             <child>
-                              <object class="GtkSpinButton" id="spinbutton_to_hours">
+                              <object class="GtkButton" id="button_to_am">
+                                <property name="label" translatable="yes">AM</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="max_width_chars">2</property>
-                                <property name="text" translatable="yes">4</property>
-                                <property name="input_purpose">number</property>
-                                <property name="orientation">vertical</property>
-                                <property name="adjustment">adjustment_to_hours</property>
-                                <property name="numeric">True</property>
-                                <property name="wrap">True</property>
-                                <property name="value">4</property>
+                                <property name="receives_default">True</property>
+                                <property name="valign">center</property>
                                 <style>
-                                  <class name="padded-spinbutton"/>
+                                  <class name="unpadded-button"/>
                                 </style>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
+                                <property name="name">am</property>
+                                <property name="title" translatable="yes">page0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkLabel">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">:</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkSpinButton" id="spinbutton_to_minutes">
+                              <object class="GtkButton" id="button_to_pm">
+                                <property name="label" translatable="yes">PM</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="max_width_chars">2</property>
-                                <property name="text" translatable="yes">0</property>
-                                <property name="orientation">vertical</property>
-                                <property name="adjustment">adjustment_to_minutes</property>
-                                <property name="numeric">True</property>
-                                <property name="wrap">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="valign">center</property>
                                 <style>
-                                  <class name="padded-spinbutton"/>
+                                  <class name="unpadded-button"/>
                                 </style>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
+                                <property name="name">pm</property>
+                                <property name="title" translatable="yes">page1</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkStack" id="stack_to">
+                              <object class="GtkLabel">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="margin_left">6</property>
-                                <child>
-                                  <object class="GtkButton" id="button_to_am">
-                                    <property name="label" translatable="yes">AM</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="valign">center</property>
-                                    <style>
-                                      <class name="unpadded-button"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="name">am</property>
-                                    <property name="title">page0</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButton" id="button_to_pm">
-                                    <property name="label" translatable="yes">PM</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <property name="valign">center</property>
-                                    <style>
-                                      <class name="unpadded-button"/>
-                                    </style>
-                                  </object>
-                                  <packing>
-                                    <property name="name">pm</property>
-                                    <property name="title">page1</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkLabel">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                  </object>
-                                  <packing>
-                                    <property name="name">blank</property>
-                                    <property name="title">page0</property>
-                                    <property name="position">2</property>
-                                  </packing>
-                                </child>
                               </object>
                               <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">3</property>
+                                <property name="name">blank</property>
+                                <property name="title" translatable="yes">page0</property>
+                                <property name="position">2</property>
                               </packing>
                             </child>
                           </object>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">True</property>
-                            <property name="position">1</property>
+                            <property name="position">3</property>
                           </packing>
                         </child>
                       </object>
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">start</property>
+                        <property name="valign">start</property>
+                        <property name="margin_left">3</property>
+                        <property name="label" translatable="yes">To</property>
+                        <style>
+                          <class name="dim-label"/>
+                        </style>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                   </object>
@@ -545,7 +562,7 @@
       <object class="GtkHeaderBar">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="title" translatable="yes" comments="This is the redshift functionality where we 
suppress blue light when the sun has gone down">Night Light</property>
+        <property name="title">Night Light</property>
         <property name="show_close_button">True</property>
       </object>
     </child>


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