[gnome-control-center] night-light: Drop the sunrise/sunset indicator



commit e5d8b6275ae64cbe9873572ebddea3add88ae406
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Mon Dec 10 16:49:41 2018 -0500

    night-light: Drop the sunrise/sunset indicator
    
    It's not in the latest design mockup:
    
    https://gitlab.gnome.org/Teams/Design/settings-mockups/raw/master/displays/night-light.png

 panels/display/cc-night-light-dialog.c  |  23 --
 panels/display/cc-night-light-dialog.ui |   8 +-
 panels/display/cc-night-light-widget.c  | 375 --------------------------------
 panels/display/cc-night-light-widget.h  |  46 ----
 panels/display/display.gresource.xml    |   2 -
 panels/display/icons/16x16/sunrise.png  | Bin 348 -> 0 bytes
 panels/display/icons/16x16/sunset.png   | Bin 361 -> 0 bytes
 panels/display/meson.build              |   5 +-
 8 files changed, 2 insertions(+), 457 deletions(-)
---
diff --git a/panels/display/cc-night-light-dialog.c b/panels/display/cc-night-light-dialog.c
index 834dced1f..abb26f07f 100644
--- a/panels/display/cc-night-light-dialog.c
+++ b/panels/display/cc-night-light-dialog.c
@@ -25,7 +25,6 @@
 #include <math.h>
 
 #include "cc-night-light-dialog.h"
-#include "cc-night-light-widget.h"
 
 #include "shell/cc-object-storage.h"
 
@@ -34,7 +33,6 @@ struct _CcNightLightDialog {
 
   GtkWidget           *box_manual;
   GtkWidget           *infobar_disabled;
-  GtkWidget           *night_light_widget;
   GtkWidget           *spinbutton_from_hours;
   GtkWidget           *spinbutton_from_minutes;
   GtkWidget           *spinbutton_to_hours;
@@ -66,14 +64,6 @@ G_DEFINE_TYPE (CcNightLightDialog, cc_night_light_dialog, GTK_TYPE_DIALOG);
 #define DISPLAY_SCHEMA   "org.gnome.settings-daemon.plugins.color"
 #define CLOCK_FORMAT_KEY "clock-format"
 
-static gdouble
-frac_day_from_dt (GDateTime *dt)
-{
-  return g_date_time_get_hour (dt) +
-          (gdouble) g_date_time_get_minute (dt) / 60.f +
-          (gdouble) g_date_time_get_second (dt) / 3600.f;
-}
-
 static void
 dialog_adjustments_set_frac_hours (CcNightLightDialog *self,
                                    gdouble             value,
@@ -144,7 +134,6 @@ dialog_update_state (CcNightLightDialog *self)
   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);
   gtk_widget_set_sensitive (self->togglebutton_automatic, enabled);
   gtk_widget_set_sensitive (self->togglebutton_manual, enabled);
 
@@ -155,11 +144,6 @@ dialog_update_state (CcNightLightDialog *self)
 
   gtk_widget_set_sensitive (self->box_manual, enabled && !automatic);
 
-  /* show the sunset & sunrise icons when required */
-  cc_night_light_widget_set_mode (CC_NIGHT_LIGHT_WIDGET (self->night_light_widget),
-                                  automatic ? CC_NIGHT_LIGHT_WIDGET_MODE_AUTOMATIC :
-                                              CC_NIGHT_LIGHT_WIDGET_MODE_MANUAL);
-
   /* set from */
   if (automatic && self->proxy_color != NULL)
     {
@@ -184,7 +168,6 @@ dialog_update_state (CcNightLightDialog *self)
                                      self->adjustment_from_hours,
                                      self->adjustment_from_minutes,
                                      self->stack_from);
-  cc_night_light_widget_set_from (CC_NIGHT_LIGHT_WIDGET (self->night_light_widget), value);
 
   /* set to */
   if (automatic && self->proxy_color != NULL)
@@ -211,10 +194,6 @@ dialog_update_state (CcNightLightDialog *self)
                                      self->adjustment_to_minutes,
                                      self->stack_to);
 
-  cc_night_light_widget_set_to (CC_NIGHT_LIGHT_WIDGET (self->night_light_widget), value);
-
-  /* set new time */
-  cc_night_light_widget_set_now (CC_NIGHT_LIGHT_WIDGET (self->night_light_widget), frac_day_from_dt (dt));
 }
 
 static gboolean
@@ -555,7 +534,6 @@ cc_night_light_dialog_class_init (CcNightLightDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, adjustment_to_minutes);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, box_manual);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, infobar_disabled);
-  gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, night_light_widget);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, spinbutton_from_hours);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, spinbutton_from_minutes);
   gtk_widget_class_bind_template_child (widget_class, CcNightLightDialog, spinbutton_to_hours);
@@ -576,7 +554,6 @@ cc_night_light_dialog_class_init (CcNightLightDialogClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, dialog_time_to_value_changed_cb);
   gtk_widget_class_bind_template_callback (widget_class, dialog_undisable_clicked_cb);
 
-  g_type_ensure (CC_TYPE_NIGHT_LIGHT_WIDGET);
 }
 
 static void
diff --git a/panels/display/cc-night-light-dialog.ui b/panels/display/cc-night-light-dialog.ui
index 5ec19dd6b..c61b3738b 100644
--- a/panels/display/cc-night-light-dialog.ui
+++ b/panels/display/cc-night-light-dialog.ui
@@ -446,12 +446,6 @@
                     </child>
                   </object>
                 </child>
-                <child>
-                  <object class="CcNightLightWidget" id="night_light_widget">
-                    <property name="visible">True</property>
-                    <property name="height_request">40</property>
-                  </object>
-                </child>
               </object>
             </child>
           </object>
@@ -492,4 +486,4 @@
     <property name="page_increment">10</property>
     <signal name="value-changed" handler="dialog_time_to_value_changed_cb" object="CcNightLightDialog" 
swapped="no" />
   </object>
-</interface>
\ No newline at end of file
+</interface>
diff --git a/panels/display/display.gresource.xml b/panels/display/display.gresource.xml
index 2a731b80c..d90ac14af 100644
--- a/panels/display/display.gresource.xml
+++ b/panels/display/display.gresource.xml
@@ -3,7 +3,5 @@
   <gresource prefix="/org/gnome/control-center/display">
     <file preprocess="xml-stripblanks">cc-night-light-dialog.ui</file>
     <file>display-arrangement.css</file>
-    <file>16x16/sunrise.png</file>
-    <file>16x16/sunset.png</file>
   </gresource>
 </gresources>
diff --git a/panels/display/meson.build b/panels/display/meson.build
index ceeaaf531..bd4352b9b 100644
--- a/panels/display/meson.build
+++ b/panels/display/meson.build
@@ -25,13 +25,10 @@ sources = files(
   'cc-display-config-manager-dbus.c',
   'cc-display-config-manager.c',
   'cc-night-light-dialog.c',
-  'cc-night-light-widget.c',
 )
 
 resource_data = files(
-  'cc-night-light-dialog.ui',
-  'icons/16x16/sunset.png',
-  'icons/16x16/sunrise.png'
+  'cc-night-light-dialog.ui'
 )
 
 sources += gnome.compile_resources(


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