[gnome-control-center/wip/every-detail-matters-round1: 5/13] display: Make night light a panel page



commit 534d290cb0d122a4fe926af425afa6b3d0534894
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jun 11 08:49:33 2019 -0300

    display: Make night light a panel page
    
    This introduces a GtkStack to handle the pages; move the
    current panel to be the "displays" page; and adds the
    Night Light page as "night-light".
    
    A stack switcher was added, as a header widget, to control
    the stack.
    
    https://gitlab.gnome.org/GNOME/gnome-control-center/issues/533

 panels/display/cc-display-panel.c  |  41 +--
 panels/display/cc-display-panel.ui | 635 ++++++++++++++++++-------------------
 2 files changed, 323 insertions(+), 353 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 5030221d0..b15a774f3 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -75,7 +75,6 @@ struct _CcDisplayPanel
 
   CcNightLightPage *night_light_page;
   GtkDialog *night_light_dialog;
-  GSettings *settings_color;
 
   UpClient *up_client;
   gboolean lid_is_closed;
@@ -104,13 +103,13 @@ struct _CcDisplayPanel
   GtkWidget      *config_type_switcher_frame;
   GtkLabel       *current_output_label;
   GtkWidget      *display_settings_frame;
-  GtkLabel       *night_light_status_label;
   GtkSwitch      *output_enabled_switch;
   GtkComboBox    *output_selection_combo;
   GtkStack       *output_selection_stack;
   GtkButtonBox   *output_selection_two_first;
   GtkButtonBox   *output_selection_two_second;
   HdyComboRow    *primary_display_row;
+  GtkWidget      *stack_switcher;
 };
 
 CC_PANEL_REGISTER (CcDisplayPanel, cc_display_panel)
@@ -428,7 +427,6 @@ cc_display_panel_dispose (GObject *object)
   g_clear_object (&self->manager);
   g_clear_object (&self->current_config);
   g_clear_object (&self->up_client);
-  g_clear_object (&self->settings_color);
 
   g_cancellable_cancel (self->shell_cancellable);
   g_clear_object (&self->shell_cancellable);
@@ -622,6 +620,14 @@ cc_display_panel_get_help_uri (CcPanel *panel)
   return "help:gnome-help/prefs-display";
 }
 
+static GtkWidget *
+cc_display_panel_get_title_widget (CcPanel *panel)
+{
+  CcDisplayPanel *self = CC_DISPLAY_PANEL (panel);
+
+  return self->stack_switcher;
+}
+
 static void
 cc_display_panel_class_init (CcDisplayPanelClass *klass)
 {
@@ -629,7 +635,10 @@ cc_display_panel_class_init (CcDisplayPanelClass *klass)
   CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
+  g_type_ensure (CC_TYPE_NIGHT_LIGHT_PAGE);
+
   panel_class->get_help_uri = cc_display_panel_get_help_uri;
+  panel_class->get_title_widget = cc_display_panel_get_title_widget;
 
   object_class->constructed = cc_display_panel_constructed;
   object_class->dispose = cc_display_panel_dispose;
@@ -644,13 +653,14 @@ cc_display_panel_class_init (CcDisplayPanelClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, config_type_single);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, current_output_label);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, display_settings_frame);
-  gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, night_light_status_label);
+  gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, night_light_page);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, output_enabled_switch);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, output_selection_combo);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, output_selection_stack);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, output_selection_two_first);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, output_selection_two_second);
   gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, primary_display_row);
+  gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, stack_switcher);
 
   gtk_widget_class_bind_template_callback (widget_class, on_config_type_toggled_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_night_light_list_box_row_activated_cb);
@@ -1132,22 +1142,6 @@ sensor_proxy_vanished_cb (GDBusConnection *connection,
   update_has_accel (self);
 }
 
-static void
-night_light_sync_label (GtkWidget *label, GSettings *settings)
-{
-  gboolean ret = g_settings_get_boolean (settings, "night-light-enabled");
-  gtk_label_set_label (GTK_LABEL (label),
-                       /* TRANSLATORS: the state of the night light setting */
-                       ret ? _("On") : _("Off"));
-}
-
-static void
-settings_color_changed_cb (GSettings *settings, gchar *key, GtkWidget *label)
-{
-  if (g_strcmp0 (key, "night-light-enabled") == 0)
-    night_light_sync_label (label, settings);
-}
-
 static void
 session_bus_ready (GObject        *source,
                    GAsyncResult   *res,
@@ -1222,13 +1216,6 @@ cc_display_panel_init (CcDisplayPanel *self)
                                  0);
   gtk_cell_renderer_set_visible (renderer, TRUE);
 
-  self->night_light_page = cc_night_light_page_new ();
-  self->settings_color = g_settings_new ("org.gnome.settings-daemon.plugins.color");
-
-  g_signal_connect_object (self->settings_color, "changed",
-                           G_CALLBACK (settings_color_changed_cb), self->night_light_status_label, 0);
-  night_light_sync_label (GTK_WIDGET (self->night_light_status_label), self->settings_color);
-
   self->up_client = up_client_new ();
   if (up_client_get_lid_is_present (self->up_client))
     {
diff --git a/panels/display/cc-display-panel.ui b/panels/display/cc-display-panel.ui
index 07b3a530f..5ceff8fdf 100644
--- a/panels/display/cc-display-panel.ui
+++ b/panels/display/cc-display-panel.ui
@@ -33,455 +33,438 @@
     <property name="icon_name">video-single-display-symbolic</property>
     <property name="icon_size">3</property>
   </object>
+  <object class="GtkStackSwitcher" id="stack_switcher">
+    <property name="visible">True</property>
+    <property name="stack">stack</property>
+  </object>
   <template class="CcDisplayPanel" parent="CcPanel">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
-      <object class="GtkScrolledWindow">
+      <object class="GtkStack" id="stack">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="hscrollbar_policy">never</property>
+        <property name="transition-type">crossfade</property>
+
+        <!-- Displays page -->
         <child>
-          <object class="GtkViewport">
+          <object class="GtkScrolledWindow">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="shadow_type">none</property>
+            <property name="hscrollbar_policy">never</property>
             <child>
-              <object class="HdyColumn">
+              <object class="GtkViewport">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="valign">start</property>
-                <property name="maximum_width">600</property>
-                <property name="linear_growth_width">400</property>
-                <property name="margin_top">32</property>
-                <property name="margin_bottom">32</property>
-                <property name="margin_start">12</property>
-                <property name="margin_end">12</property>
+                <property name="shadow_type">none</property>
                 <child>
-                  <object class="GtkBox">
+                  <object class="HdyColumn">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">32</property>
+                    <property name="valign">start</property>
+                    <property name="maximum_width">600</property>
+                    <property name="linear_growth_width">400</property>
+                    <property name="margin_top">32</property>
+                    <property name="margin_bottom">32</property>
+                    <property name="margin_start">12</property>
+                    <property name="margin_end">12</property>
                     <child>
-                      <object class="GtkFrame" id="config_type_switcher_frame">
+                      <object class="GtkBox">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">none</property>
+                        <property name="hexpand">True</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">32</property>
                         <child>
-                          <object class="GtkButtonBox">
+                          <object class="GtkFrame" id="config_type_switcher_frame">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="homogeneous">True</property>
-                            <property name="layout_style">expand</property>
-                            <child>
-                              <object class="GtkRadioButton" id="config_type_single">
-                                <property name="label" translatable="yes">Single Display</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="image">image-single-display</property>
-                                <property name="always_show_image">True</property>
-                                <property name="active">True</property>
-                                <property name="draw_indicator">False</property>
-                                <property name="group">config_type_join</property>
-                                <signal name="toggled" handler="on_config_type_toggled_cb" swapped="yes"/>
-                             </object>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
+                            <property name="label_xalign">0</property>
+                            <property name="shadow_type">none</property>
                             <child>
-                              <object class="GtkRadioButton" id="config_type_join">
-                                <property name="label" translatable="yes">Join Displays</property>
+                              <object class="GtkButtonBox">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="image">image-join-displays</property>
-                                <property name="always_show_image">True</property>
-                                <property name="active">True</property>
-                                <property name="draw_indicator">False</property>
-                                <signal name="toggled" handler="on_config_type_toggled_cb" swapped="yes"/>
+                                <property name="can_focus">False</property>
+                                <property name="homogeneous">True</property>
+                                <property name="layout_style">expand</property>
+                                <child>
+                                  <object class="GtkRadioButton" id="config_type_single">
+                                    <property name="label" translatable="yes">Single Display</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="image">image-single-display</property>
+                                    <property name="always_show_image">True</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">False</property>
+                                    <property name="group">config_type_join</property>
+                                    <signal name="toggled" handler="on_config_type_toggled_cb" 
swapped="yes"/>
+                                 </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="config_type_join">
+                                    <property name="label" translatable="yes">Join Displays</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="image">image-join-displays</property>
+                                    <property name="always_show_image">True</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">False</property>
+                                    <signal name="toggled" handler="on_config_type_toggled_cb" 
swapped="yes"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="config_type_mirror">
+                                    <property name="label" translatable="yes">Mirror</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="image">image-mirror</property>
+                                    <property name="always_show_image">True</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">False</property>
+                                    <property name="group">config_type_join</property>
+                                    <signal name="toggled" handler="on_config_type_toggled_cb" 
swapped="yes"/>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
                               </object>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
                             </child>
-                            <child>
-                              <object class="GtkRadioButton" id="config_type_mirror">
-                                <property name="label" translatable="yes">Mirror</property>
+                            <child type="label">
+                              <object class="GtkLabel">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="image">image-mirror</property>
-                                <property name="always_show_image">True</property>
-                                <property name="active">True</property>
-                                <property name="draw_indicator">False</property>
-                                <property name="group">config_type_join</property>
-                                <signal name="toggled" handler="on_config_type_toggled_cb" swapped="yes"/>
+                                <property name="can_focus">False</property>
+                                <property name="halign">start</property>
+                                <property name="margin_bottom">12</property>
+                                <property name="label" translatable="yes">Display Mode</property>
+                                <attributes>
+                                  <attribute name="weight" value="bold"/>
+                                </attributes>
                               </object>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
                             </child>
                           </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
                         </child>
-                        <child type="label">
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="halign">start</property>
-                            <property name="margin_bottom">12</property>
-                            <property name="label" translatable="yes">Display Mode</property>
-                            <attributes>
-                              <attribute name="weight" value="bold"/>
-                            </attributes>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkFrame" id="arrangement_frame">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label_xalign">0</property>
-                        <property name="label_yalign">1</property>
-                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkFrame" id="arrangement_frame">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">12</property>
+                            <property name="label_xalign">0</property>
+                            <property name="label_yalign">1</property>
+                            <property name="shadow_type">none</property>
                             <child>
-                              <object class="GtkFrame">
+                              <object class="GtkBox">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="label_xalign">0</property>
-                                <property name="shadow_type">in</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">12</property>
                                 <child>
-                                  <object class="GtkAlignment" id="arrangement_bin">
+                                  <object class="GtkFrame">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="shadow_type">in</property>
                                     <child>
+                                      <object class="GtkAlignment" id="arrangement_bin">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <placeholder/>
+                                        </child>
+                                      </object>
+                                    </child>
+                                    <child type="label_item">
                                       <placeholder/>
                                     </child>
+                                    <style>
+                                      <class name="view"/>
+                                    </style>
                                   </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
                                 </child>
-                                <child type="label_item">
-                                  <placeholder/>
-                                </child>
-                                <style>
-                                  <class name="view"/>
-                                </style>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkFrame">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label_xalign">0</property>
-                                <property name="shadow_type">in</property>
                                 <child>
-                                  <object class="GtkListBox">
+                                  <object class="GtkFrame">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="selection_mode">none</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="shadow_type">in</property>
                                     <child>
-                                      <object class="HdyComboRow" id="primary_display_row">
+                                      <object class="GtkListBox">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="subtitle">Contains top bar and Activities</property>
-                                        <property name="title">Primary Display</property>
-                                        <signal name="notify::selected-index" 
handler="on_primary_display_selected_index_changed_cb" swapped="yes"/>
+                                        <property name="can_focus">False</property>
+                                        <property name="selection_mode">none</property>
+                                        <child>
+                                          <object class="HdyComboRow" id="primary_display_row">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="subtitle">Contains top bar and 
Activities</property>
+                                            <property name="title">Primary Display</property>
+                                            <signal name="notify::selected-index" 
handler="on_primary_display_selected_index_changed_cb" swapped="yes"/>
+                                          </object>
+                                        </child>
                                       </object>
                                     </child>
+                                    <child type="label_item">
+                                      <placeholder/>
+                                    </child>
                                   </object>
-                                </child>
-                                <child type="label_item">
-                                  <placeholder/>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
                                 </child>
                               </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
+                            </child>
+                            <child type="label">
+                              <object class="GtkLabel">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="label" translatable="yes">Drag displays to match your 
physical display setup. Select a display to change its settings.</property>
+                                <property name="wrap">True</property>
+                                <property name="margin_bottom">12</property>
+                              </object>
+                            </child>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="frame_arrangement-atkobject">
+                                <property name="AtkObject::accessible-name" translatable="yes">Display 
Arrangement</property>
+                              </object>
                             </child>
                           </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
                         </child>
-                        <child type="label">
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Drag displays to match your physical 
display setup. Select a display to change its settings.</property>
-                            <property name="wrap">True</property>
-                            <property name="margin_bottom">12</property>
-                          </object>
-                        </child>
-                        <child internal-child="accessible">
-                          <object class="AtkObject" id="frame_arrangement-atkobject">
-                            <property name="AtkObject::accessible-name" translatable="yes">Display 
Arrangement</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkFrame">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">none</property>
                         <child>
-                          <object class="GtkBox">
+                          <object class="GtkFrame">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="orientation">vertical</property>
-                            <property name="spacing">12</property>
+                            <property name="label_xalign">0</property>
+                            <property name="shadow_type">none</property>
                             <child>
-                              <object class="GtkStack" id="output_selection_stack">
+                              <object class="GtkBox">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="hhomogeneous">False</property>
-                                <property name="vhomogeneous">False</property>
+                                <property name="orientation">vertical</property>
+                                <property name="spacing">12</property>
                                 <child>
-                                  <object class="GtkLabel" id="current_output_label">
+                                  <object class="GtkStack" id="output_selection_stack">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="halign">start</property>
-                                    <attributes>
-                                      <attribute name="weight" value="bold"/>
-                                    </attributes>
-                                  </object>
-                                  <packing>
-                                    <property name="name">no-selection</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkButtonBox">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="layout_style">expand</property>
+                                    <property name="hhomogeneous">False</property>
+                                    <property name="vhomogeneous">False</property>
                                     <child>
-                                      <object class="GtkRadioButton" id="output_selection_two_first">
+                                      <object class="GtkLabel" id="current_output_label">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">False</property>
-                                        <property name="draw_indicator">False</property>
-                                        <property name="group">output_selection_two_second</property>
-                                        <signal name="toggled" handler="on_output_selection_two_toggled_cb" 
swapped="yes"/>
-                                     </object>
+                                        <property name="can_focus">False</property>
+                                        <property name="halign">start</property>
+                                        <attributes>
+                                          <attribute name="weight" value="bold"/>
+                                        </attributes>
+                                      </object>
                                       <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
+                                        <property name="name">no-selection</property>
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkRadioButton" id="output_selection_two_second">
-                                        <property name="label" translatable="yes">Join Displays</property>
+                                      <object class="GtkButtonBox">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">False</property>
-                                        <property name="draw_indicator">False</property>
-                                        <signal name="toggled" handler="on_output_selection_two_toggled_cb" 
swapped="yes"/>
+                                        <property name="can_focus">False</property>
+                                        <property name="layout_style">expand</property>
+                                        <child>
+                                          <object class="GtkRadioButton" id="output_selection_two_first">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">False</property>
+                                            <property name="group">output_selection_two_second</property>
+                                            <signal name="toggled" 
handler="on_output_selection_two_toggled_cb" swapped="yes"/>
+                                         </object>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkRadioButton" id="output_selection_two_second">
+                                            <property name="label" translatable="yes">Join 
Displays</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">False</property>
+                                            <signal name="toggled" 
handler="on_output_selection_two_toggled_cb" swapped="yes"/>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
                                       </object>
                                       <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
+                                        <property name="name">two-selection</property>
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
-                                  </object>
-                                  <packing>
-                                    <property name="name">two-selection</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <object class="GtkBox">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
                                     <child>
-                                      <object class="GtkComboBox" id="output_selection_combo">
+                                      <object class="GtkBox">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="halign">start</property>
-                                        <property name="hexpand">True</property>
-                                        <signal name="changed" 
handler="on_output_selection_combo_changed_cb" swapped="yes"/>
+                                        <child>
+                                          <object class="GtkComboBox" id="output_selection_combo">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="halign">start</property>
+                                            <property name="hexpand">True</property>
+                                            <signal name="changed" 
handler="on_output_selection_combo_changed_cb" swapped="yes"/>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkSwitch" id="output_enabled_switch">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="halign">end</property>
+                                            <property name="valign">center</property>
+                                            <signal name="notify::active" 
handler="on_output_enabled_active_changed_cb" swapped="yes"/>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
                                       </object>
                                       <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
+                                        <property name="name">multi-selection</property>
+                                        <property name="position">2</property>
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkSwitch" id="output_enabled_switch">
+                                      <object class="GtkFrame">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="halign">end</property>
-                                        <property name="valign">center</property>
-                                        <signal name="notify::active" 
handler="on_output_enabled_active_changed_cb" swapped="yes"/>
+                                        <property name="can_focus">False</property>
+                                        <property name="label_xalign">0</property>
+                                        <property name="shadow_type">in</property>
+                                        <child>
+                                          <object class="GtkListBox">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="selection_mode">none</property>
+                                            <child>
+                                              <object class="HdyComboRow">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="title">Active Display</property>
+                                              </object>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child type="label_item">
+                                          <placeholder/>
+                                        </child>
                                       </object>
                                       <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">1</property>
+                                        <property name="name">single-select</property>
+                                        <property name="position">3</property>
                                       </packing>
                                     </child>
                                   </object>
                                   <packing>
-                                    <property name="name">multi-selection</property>
-                                    <property name="position">2</property>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkFrame">
+                                  <object class="GtkFrame" id="display_settings_frame">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
                                     <property name="label_xalign">0</property>
                                     <property name="shadow_type">in</property>
                                     <child>
-                                      <object class="GtkListBox">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="selection_mode">none</property>
-                                        <child>
-                                          <object class="HdyComboRow">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">True</property>
-                                            <property name="title">Active Display</property>
-                                          </object>
-                                        </child>
-                                      </object>
+                                      <placeholder/>
                                     </child>
                                     <child type="label_item">
                                       <placeholder/>
                                     </child>
                                   </object>
                                   <packing>
-                                    <property name="name">single-select</property>
-                                    <property name="position">3</property>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">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="GtkFrame" id="display_settings_frame">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label_xalign">0</property>
-                                <property name="shadow_type">in</property>
-                                <child>
-                                  <placeholder/>
-                                </child>
-                                <child type="label_item">
-                                  <placeholder/>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
+                            <child type="label_item">
+                              <placeholder/>
                             </child>
-                          </object>
-                        </child>
-                        <child type="label_item">
-                          <placeholder/>
-                        </child>
-                        <child internal-child="accessible">
-                          <object class="AtkObject">
-                            <property name="AtkObject::accessible-name" translatable="yes">Display 
Configuration</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkFrame">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label_xalign">0</property>
-                        <property name="shadow_type">in</property>
-                        <child>
-                          <object class="GtkListBox">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="selection_mode">none</property>
-                            <signal name="row-activated" handler="on_night_light_list_box_row_activated_cb" 
swapped="yes"/>
-                            <child>
-                              <object class="HdyActionRow">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="selectable">False</property>
-                                <property name="title" translatable="yes">Night Light</property>
-                                <child type="action">
-                                  <object class="GtkLabel" id="night_light_status_label">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="halign">end</property>
-                                    <property name="label" translatable="no">-</property>
-                                  </object>
-                                </child>
+                            <child internal-child="accessible">
+                              <object class="AtkObject">
+                                <property name="AtkObject::accessible-name" translatable="yes">Display 
Configuration</property>
                               </object>
                             </child>
                           </object>
-                        </child>
-                        <child type="label_item">
-                          <placeholder/>
-                        </child>
-                        <child internal-child="accessible">
-                          <object class="AtkObject">
-                            <property name="AtkObject::accessible-name" translatable="yes">Night 
Light</property>
-                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</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>
-                      </packing>
                     </child>
                   </object>
                 </child>
               </object>
             </child>
           </object>
+          <packing>
+            <property name="name">displays</property>
+            <property name="title" translatable="yes">Displays</property>
+          </packing>
+        </child>
+
+        <!-- Night Light page -->
+        <child>
+          <object class="CcNightLightPage" id="night_light_page">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="name">night-light</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>
+          </packing>
         </child>
+
       </object>
     </child>
   </template>


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