Commit b2f1d489 authored by Benjamin Berg's avatar Benjamin Berg

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.
parent e387b3bb
......@@ -664,11 +664,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)
......@@ -722,6 +724,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;
......@@ -744,13 +753,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment