From ce9c7c289a8e4427d86aea8cb9f71041090483b7 Mon Sep 17 00:00:00 2001 From: Emad Saadat Date: Sat, 25 Mar 2023 19:14:36 -0700 Subject: display: Make nightlight widgets clamped to same size as other panels by using an AdwPreferencesPage instead of a plain GtkBox. And also move disabled infobar out of night_light_settings. --- panels/display/cc-night-light-page.c | 2 - panels/display/cc-night-light-page.ui | 516 ++++++++++++++++------------------ 2 files changed, 241 insertions(+), 277 deletions(-) diff --git a/panels/display/cc-night-light-page.c b/panels/display/cc-night-light-page.c index 8c1f6339b..d21a9a269 100644 --- a/panels/display/cc-night-light-page.c +++ b/panels/display/cc-night-light-page.c @@ -42,7 +42,6 @@ struct _CcNightLightPage { GtkWidget *infobar_unsupported; GtkWidget *infobar_unsupported_description; GtkWidget *infobar_disabled; - GtkListBox *listbox; GtkWidget *scale_color_temperature; GtkWidget *night_light_toggle_switch; GtkComboBox *schedule_type_combo; @@ -665,7 +664,6 @@ cc_night_light_page_class_init (CcNightLightPageClass *klass) gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, infobar_unsupported); gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, infobar_unsupported_description); gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, infobar_disabled); - gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, listbox); gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, night_light_toggle_switch); gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, schedule_type_combo); gtk_widget_class_bind_template_child (widget_class, CcNightLightPage, scale_color_temperature); diff --git a/panels/display/cc-night-light-page.ui b/panels/display/cc-night-light-page.ui index a7142f1e3..c76e9d0b6 100644 --- a/panels/display/cc-night-light-page.ui +++ b/panels/display/cc-night-light-page.ui @@ -40,299 +40,266 @@ - - center - start - vertical + + infobar_disabled - - infobar_disabled - - - True - 16 - - - start - 12 - False - True - Temporarily Disabled Until Tomorrow - - - - - - - + + True + 16 - - 12 - 12 + + start 12 - 12 - Restart Filter - button_undisable - True - True - GTK_ALIGN_CENTER - + False + Temporarily Disabled Until Tomorrow + + + - - - 30 - 12 - 12 - 36 - vertical - 26 - - - start - start - Night light makes the screen color warmer. This can help to prevent eye strain and sleeplessness. - True - 60 - 0 - - - + + 12 + 12 + 12 + 12 + Restart Filter + button_undisable + True + True + GTK_ALIGN_CENTER + + + + + + + + + + Night light makes the screen color warmer. This can help to prevent eye strain and sleeplessness. + - - none + + Night Light + night_light_toggle_switch - - - - - Night Light - night_light_toggle_switch - - - - center - - Enable - - - + + center + + Enable + + + - - - - Schedule - + + + + Schedule + - - - center - - - Sunset to Sunrise - Manual Schedule - - - schedule_row - - - + + + center + + + Sunset to Sunrise + Manual Schedule + + + schedule_row + + + - - - - Times - + + + + Times + + + + 6 + 12 + 12 + - - 6 - 12 - 12 + + From + spinbutton_from_hours + + + + + 4 + + + True + 2 + 4 + vertical + adjustment_from_hours + True + True + 4 + + + + Hour + + + - From - spinbutton_from_hours + : + + + + + True + 2 + 0 + vertical + adjustment_from_minutes + True + True + + + Minute + - - 4 + + False + False - + + AM True - 2 - 4 - vertical - adjustment_from_hours - True - True - 4 - + True + center + - - Hour - - - : - - - - + + PM True - 2 - 0 - vertical - adjustment_from_minutes - True - True - + True + center + - - Minute - - - - - - False - False - - - AM - True - True - center - - - - - - - PM - True - True - center - - - - + + + + + 6 + To + spinbutton_to_hours + + + + + + 4 + + + True + 2 + 4 + vertical + adjustment_to_hours + True + True + 4 + + + + Hour + + + - 6 - To - spinbutton_to_hours + : + + + + + True + 2 + 0 + vertical + adjustment_to_minutes + True + True + + + Minute + - - 4 + + False + False - + + AM True - 2 - 4 - vertical - adjustment_to_hours - True - True - 4 - + True + center + - - Hour - - - - - - : - + + PM True - 2 - 0 - vertical - adjustment_to_minutes - True - True - + True + center + - - Minute - - - - - - False - False - - - AM - True - True - center - - - - - - - PM - True - True - center - - - - @@ -341,53 +308,52 @@ + + + + + + + False + - - - False - + + 12 + 12 + 12 + 12 + 6 + vertical - - 12 - 12 - 12 - 12 - 6 - vertical - - - - Color Temperature - none - 0 - 0.0 - scale_color_temperature - - - - - - - True - 280 - adjustment_color_temperature - True - False - 1 - 0 - False - False - bottom - - - + + Color Temperature + none + 0 + 0.0 + scale_color_temperature + + + + + + True + 280 + adjustment_color_temperature + True + False + 1 + 0 + False + False + bottom + -- cgit v1.2.1