[gnome-control-center/wip/carlosg/display-papercuts: 4/5] display: Make "Mirror" option show a single configuration for all displays




commit c60131a25e7a803979ae86cbee57542635bda101
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jul 6 14:16:58 2022 +0200

    display: Make "Mirror" option show a single configuration for all displays
    
    Since all displays are constrained to the same options, promote one so it's
    shown in the main panel, the rest does work itself out.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1849

 panels/display/cc-display-panel.c    | 11 ++++++++---
 panels/display/cc-display-settings.c |  1 -
 2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 66e13eb46..5f7ab2e6f 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -823,11 +823,14 @@ rebuild_ui (CcDisplayPanel *panel)
       if (type > CC_DISPLAY_CONFIG_LAST_VALID)
         type = CC_DISPLAY_CONFIG_JOIN;
 
-      gtk_widget_set_visible (panel->display_settings_group, TRUE);
+      gtk_widget_set_visible (panel->display_settings_group, type == CC_DISPLAY_CONFIG_JOIN);
       gtk_widget_set_visible (panel->display_multiple_displays, TRUE);
       gtk_widget_set_visible (panel->arrangement_row, type == CC_DISPLAY_CONFIG_JOIN);
 
-      move_display_settings_to_separate_page (panel);
+      if (type == CC_DISPLAY_CONFIG_CLONE)
+        move_display_settings_to_main_page (panel);
+      else
+        move_display_settings_to_separate_page (panel);
     }
   else if (n_usable_outputs > 1)
     {
@@ -855,7 +858,9 @@ rebuild_ui (CcDisplayPanel *panel)
       move_display_settings_to_main_page (panel);
     }
 
-  cc_display_settings_set_multimonitor (panel->settings, n_outputs > 1);
+  cc_display_settings_set_multimonitor (panel->settings,
+                                        n_outputs > 1 &&
+                                        type != CC_DISPLAY_CONFIG_CLONE);
 
   cc_panel_set_selected_type (panel, type);
 
diff --git a/panels/display/cc-display-settings.c b/panels/display/cc-display-settings.c
index 21a0a1ad8..7c33f4928 100644
--- a/panels/display/cc-display-settings.c
+++ b/panels/display/cc-display-settings.c
@@ -280,7 +280,6 @@ cc_display_settings_rebuild_ui (CcDisplaySettings *self)
   }
 
   /* Enabled Switch */
-  gtk_widget_set_visible (self->enabled_listbox, TRUE);
   adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self->enabled_row),
                                  cc_display_monitor_get_ui_name (self->selected_output));
   gtk_switch_set_active (GTK_SWITCH (self->enabled_switch),


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