[gnome-control-center/benzea/ensure-valid-config-after-loading: 89/91] display: Add unusable monitors to dropdown and disable switch for them
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/ensure-valid-config-after-loading: 89/91] display: Add unusable monitors to dropdown and disable switch for them
- Date: Wed, 20 Mar 2019 14:20:05 +0000 (UTC)
commit e365d72468c7385177ee3e2f26a534b5b8f44903
Author: Benjamin Berg <bberg redhat com>
Date: Wed Mar 20 15:10:21 2019 +0100
display: Add unusable monitors to dropdown and disable switch for them
We should show unusable monitors in the monitor selection drop-down
list. So always add them to the combobox and add the code to make the
switch to enable them insensitive.
panels/display/cc-display-panel.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 644e24c36..0b38be52d 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -667,11 +667,13 @@ set_current_output (CcDisplayPanel *panel,
{
gtk_label_set_text (panel->current_output_label, cc_display_monitor_get_ui_name
(panel->current_output));
gtk_switch_set_active (panel->output_enabled_switch, cc_display_monitor_is_active
(panel->current_output));
+ gtk_widget_set_sensitive (GTK_WIDGET (panel->output_enabled_switch), cc_display_monitor_is_usable
(panel->current_output));
}
else
{
gtk_label_set_text (panel->current_output_label, "");
gtk_switch_set_active (panel->output_enabled_switch, FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (panel->output_enabled_switch), FALSE);
}
if (g_object_get_data (G_OBJECT (panel->output_selection_two_first), "display") == output)
@@ -725,6 +727,13 @@ rebuild_ui (CcDisplayPanel *panel)
GtkTreeIter iter;
CcDisplayMonitor *output = l->data;
+ gtk_list_store_append (panel->output_selection_list, &iter);
+ gtk_list_store_set (panel->output_selection_list,
+ &iter,
+ 0, cc_display_monitor_get_ui_number_name (output),
+ 1, output,
+ -1);
+
if (!cc_display_monitor_is_usable (output))
continue;
@@ -747,13 +756,6 @@ rebuild_ui (CcDisplayPanel *panel)
output);
}
- gtk_list_store_append (panel->output_selection_list, &iter);
- gtk_list_store_set (panel->output_selection_list,
- &iter,
- 0, cc_display_monitor_get_ui_number_name (output),
- 1, output,
- -1);
-
if (cc_display_monitor_is_active (output))
{
n_active_outputs += 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]