diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c index 544cfd9be5fdc5c581df04d1b9385179e31c5f64..838825c305bbe2623454915fd8d31ed4d328db5a 100644 --- a/panels/power/cc-power-panel.c +++ b/panels/power/cc-power-panel.c @@ -41,8 +41,8 @@ struct _CcPowerPanel CcPanel parent_instance; AdwSwitchRow *als_row; - AdwDialog *automatic_suspend_dialog; - CcListRow *automatic_suspend_row; + AdwActionRow *automatic_suspend_row; + GtkLabel *automatic_suspend_label; GtkListBox *battery_listbox; AdwSwitchRow *battery_percentage_row; AdwPreferencesGroup *battery_section; @@ -59,7 +59,6 @@ struct _CcPowerPanel AdwSwitchRow *power_saver_low_battery_row; GtkComboBox *suspend_on_battery_delay_combo; AdwSwitchRow *suspend_on_battery_switch_row; - GtkWidget *suspend_on_battery_group; GtkComboBox *suspend_on_ac_delay_combo; AdwSwitchRow *suspend_on_ac_switch_row; @@ -446,7 +445,8 @@ set_ac_battery_ui_mode (CcPowerPanel *self) if (!self->has_batteries) { - gtk_widget_set_visible (GTK_WIDGET (self->suspend_on_battery_group), FALSE); + gtk_widget_set_visible (GTK_WIDGET (self->suspend_on_battery_switch_row), FALSE); + gtk_widget_set_visible (GTK_WIDGET (self->suspend_on_battery_delay_combo), FALSE); adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self->suspend_on_ac_switch_row), _("When _Idle")); } } @@ -660,7 +660,7 @@ update_automatic_suspend_label (CcPowerPanel *self) s = _("On"); } - cc_list_row_set_secondary_label (self->automatic_suspend_row, s); + gtk_label_set_label (self->automatic_suspend_label, s); } static void @@ -1346,7 +1346,7 @@ cc_power_panel_class_init (CcPowerPanelClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/power/cc-power-panel.ui"); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, als_row); - gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, automatic_suspend_dialog); + gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, automatic_suspend_label); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, automatic_suspend_row); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, battery_listbox); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, battery_percentage_row); @@ -1364,7 +1364,6 @@ cc_power_panel_class_init (CcPowerPanelClass *klass) gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, power_saver_low_battery_row); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, suspend_on_battery_delay_combo); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, suspend_on_battery_switch_row); - gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, suspend_on_battery_group); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, suspend_on_ac_delay_combo); gtk_widget_class_bind_template_child (widget_class, CcPowerPanel, suspend_on_ac_switch_row); diff --git a/panels/power/cc-power-panel.ui b/panels/power/cc-power-panel.ui index 97c93065494f2e42e904a29f3aae04b56a23450c..796d98e3369a203340f931cead07ca358ab60313 100644 --- a/panels/power/cc-power-panel.ui +++ b/panels/power/cc-power-panel.ui @@ -184,12 +184,59 @@ - - False + _Automatic Suspend Pause the device after a period of inactivity - True - + True + + + + + + + + On _Battery Power + True + + + + + suspend_on_battery_delay_combo + _Delay + True + + + 0 + 1 + time_liststore + center + + + + + + + When _Plugged In + True + + + + + D_elay + True + suspend_on_ac_delay_combo + + + 0 + 1 + time_liststore + center + + + + @@ -220,70 +267,4 @@ - - - Automatic Suspend - 400 - - - - - - - - - - - - On _Battery Power - True - - - - - suspend_on_battery_delay_combo - _Delay - True - - - 0 - 1 - time_liststore - center - - - - - - - - - - - When _Plugged In - True - - - - - D_elay - True - suspend_on_ac_delay_combo - - - 0 - 1 - time_liststore - center - - - - - - - - - - -