[gnome-control-center/wip/carlosg/display-papercuts: 3/5] display: Set "Multiple Displays" option on top
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/carlosg/display-papercuts: 3/5] display: Set "Multiple Displays" option on top
- Date: Wed, 6 Jul 2022 16:44:28 +0000 (UTC)
commit c789e990557344a89305f143af5772c498afa750
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jul 5 19:56:23 2022 +0200
display: Set "Multiple Displays" option on top
And make the display arrangements widget a row of the displays
preferences group, as per the latest mockups.
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1851
panels/display/cc-display-panel.c | 23 ++++++++++++-----------
panels/display/cc-display-panel.ui | 32 +++++++++++++++-----------------
2 files changed, 27 insertions(+), 28 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 79d51c2c3..66e13eb46 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -92,11 +92,11 @@ struct _CcDisplayPanel
GtkWidget *display_settings_disabled_group;
- GtkWidget *arrangement_group;
+ GtkWidget *arrangement_row;
AdwBin *arrangement_bin;
GtkToggleButton *config_type_join;
GtkToggleButton *config_type_mirror;
- GtkWidget *config_type_switcher_row;
+ GtkWidget *display_multiple_displays;
AdwBin *display_settings_bin;
GtkWidget *display_settings_group;
AdwWindowTitle *display_settings_title_widget;
@@ -607,10 +607,10 @@ cc_display_panel_class_init (CcDisplayPanelClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, apply_titlebar);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, apply_titlebar_title_widget);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, display_settings_disabled_group);
- gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, arrangement_group);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, arrangement_bin);
+ gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, arrangement_row);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, cancel_button);
- gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, config_type_switcher_row);
+ gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, display_multiple_displays);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, config_type_join);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, config_type_mirror);
gtk_widget_class_bind_template_child (widget_class, CcDisplayPanel, display_settings_bin);
@@ -692,6 +692,7 @@ add_display_row (CcDisplayPanel *self,
number_string = g_strdup_printf ("%d", cc_display_monitor_get_ui_number (monitor));
number_label = gtk_label_new (number_string);
gtk_widget_set_valign (number_label, GTK_ALIGN_CENTER);
+ gtk_widget_set_halign (number_label, GTK_ALIGN_CENTER);
gtk_widget_add_css_class (number_label, "monitor-label");
adw_action_row_add_prefix (ADW_ACTION_ROW (row), number_label);
@@ -752,7 +753,7 @@ rebuild_ui (CcDisplayPanel *panel)
{
gtk_widget_set_visible (panel->display_settings_disabled_group, TRUE);
gtk_widget_set_visible (panel->display_settings_group, FALSE);
- gtk_widget_set_visible (panel->arrangement_group, FALSE);
+ gtk_widget_set_visible (panel->arrangement_row, FALSE);
return;
}
@@ -823,8 +824,8 @@ rebuild_ui (CcDisplayPanel *panel)
type = CC_DISPLAY_CONFIG_JOIN;
gtk_widget_set_visible (panel->display_settings_group, TRUE);
- gtk_widget_set_visible (panel->config_type_switcher_row, TRUE);
- gtk_widget_set_visible (panel->arrangement_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);
}
@@ -834,8 +835,8 @@ rebuild_ui (CcDisplayPanel *panel)
* and we always show the arrangement widget.
*/
gtk_widget_set_visible (panel->display_settings_group, TRUE);
- gtk_widget_set_visible (panel->config_type_switcher_row, FALSE);
- gtk_widget_set_visible (panel->arrangement_group, TRUE);
+ gtk_widget_set_visible (panel->display_multiple_displays, FALSE);
+ gtk_widget_set_visible (panel->arrangement_row, TRUE);
/* Mirror is also invalid as it cannot be configured using this UI. */
if (type == CC_DISPLAY_CONFIG_CLONE || type > CC_DISPLAY_CONFIG_LAST_VALID)
@@ -848,8 +849,8 @@ rebuild_ui (CcDisplayPanel *panel)
type = CC_DISPLAY_CONFIG_JOIN;
gtk_widget_set_visible (panel->display_settings_group, FALSE);
- gtk_widget_set_visible (panel->config_type_switcher_row, FALSE);
- gtk_widget_set_visible (panel->arrangement_group, FALSE);
+ gtk_widget_set_visible (panel->display_multiple_displays, FALSE);
+ gtk_widget_set_visible (panel->arrangement_row, FALSE);
move_display_settings_to_main_page (panel);
}
diff --git a/panels/display/cc-display-panel.ui b/panels/display/cc-display-panel.ui
index 63ec8378c..510a82499 100644
--- a/panels/display/cc-display-panel.ui
+++ b/panels/display/cc-display-panel.ui
@@ -104,23 +104,7 @@
</child>
<child>
- <object class="AdwPreferencesGroup" id="arrangement_group">
- <child>
- <object class="AdwBin" id="arrangement_bin">
- <style>
- <class name="card"/>
- </style>
- </object>
- </child>
- <accessibility>
- <property name="label" translatable="yes">Display Arrangement</property>
- </accessibility>
- </object>
- </child>
-
- <child>
- <object class="AdwPreferencesGroup" id="display_settings_group">
-
+ <object class="AdwPreferencesGroup" id="display_multiple_displays">
<!-- Config Type -->
<child>
<object class="AdwActionRow" id="config_type_switcher_row">
@@ -149,6 +133,20 @@
</child>
</object>
</child>
+ </object>
+ </child>
+
+ <child>
+ <object class="AdwPreferencesGroup" id="display_settings_group">
+ <!-- Display Arrangement -->
+ <child>
+ <object class="AdwPreferencesRow" id="arrangement_row">
+ <child>
+ <object class="AdwBin" id="arrangement_bin">
+ </object>
+ </child>
+ </object>
+ </child>
<!-- Primary Display -->
<child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]