temp/gnome-control-center: use upstream as source (MR 2552)

Purism's g-c-c fork is stuck in version 3.38. This has
multiple problems, including carrying old unnecessary
patches and producing some incompatibility with newer
GNOME releases available in Alpine. In consequence,
we fetch the source from upstream and only apply those
patches that make sense for our usecase. When the Purism
patches apply without issues, then we fetch them directly
from their repo.
This commit is contained in:
Pablo Correa Gómez 2021-09-22 23:40:04 +02:00 committed by Newbyte
parent 2ed1fdbe4e
commit 5411328605
No known key found for this signature in database
GPG key ID: 5873C171C9429CFA
9 changed files with 6065 additions and 53 deletions

View file

@ -1,7 +1,7 @@
From ff3c623cf1fbd681bc123417da4a4c23390ceb7b Mon Sep 17 00:00:00 2001 From 4c467035e7f541cbe5d523497488caffecb61663 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com> From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Sun, 18 Jul 2021 20:53:01 +0200 Date: Sun, 18 Jul 2021 20:53:01 +0200
Subject: [PATCH] Hide and disable building printer panel Subject: [PATCH 1/8] Hide and disable building printer panel
The printer panel requires `libcups`, which is known to crash The printer panel requires `libcups`, which is known to crash
in Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/issues/11937 in Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/issues/11937
@ -9,38 +9,16 @@ Opening the printer panel crashes g-c-c and prevents it from
opening again. Hide and do not build the panel until the upstream opening again. Hide and do not build the panel until the upstream
issue is fixed issue is fixed
--- ---
debian/patches/pureos/shell-Hide-some-panels-on-phones.patch | 3 +-- panels/meson.build | 1 -
panels/meson.build | 1 - shell/cc-panel-loader.c | 2 --
shell/cc-panel-loader.c | 2 -- tests/meson.build | 1 -
tests/meson.build | 1 - 3 files changed, 4 deletions(-)
4 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/debian/patches/pureos/shell-Hide-some-panels-on-phones.patch b/debian/patches/pureos/shell-Hide-some-panels-on-phones.patch
index 3fd0eac5c..3a17401fb 100644
--- a/debian/patches/pureos/shell-Hide-some-panels-on-phones.patch
+++ b/debian/patches/pureos/shell-Hide-some-panels-on-phones.patch
@@ -33,7 +33,7 @@ new file mode 100644
index 0000000..e8a446c
--- /dev/null
+++ b/shell/phone-panels.h
-@@ -0,0 +1,52 @@
+@@ -0,0 +1,51 @@
+static CcPanelLoaderVtable phone_panels[] =
+ {
+ /* PANEL_TYPE("applications", cc_applications_panel_get_type, NULL), */
@@ -60,7 +60,6 @@ index 0000000..e8a446c
+ PANEL_TYPE("notifications", cc_notifications_panel_get_type, NULL),
+ PANEL_TYPE("online-accounts", cc_goa_panel_get_type, NULL),
+ PANEL_TYPE("power", cc_power_panel_get_type, NULL),
-+ PANEL_TYPE("printers", cc_printers_panel_get_type, NULL),
+ PANEL_TYPE("region", cc_region_panel_get_type, NULL),
+ /* PANEL_TYPE("removable-media", cc_removable_media_panel_get_type, NULL), */
+ PANEL_TYPE("search", cc_search_panel_get_type, NULL),
diff --git a/panels/meson.build b/panels/meson.build diff --git a/panels/meson.build b/panels/meson.build
index 2f4fdc5e3..7113a9867 100644 index f603db919..9df1ec2a3 100644
--- a/panels/meson.build --- a/panels/meson.build
+++ b/panels/meson.build +++ b/panels/meson.build
@@ -18,7 +18,6 @@ panels = [ @@ -19,7 +19,6 @@ panels = [
'notifications', 'notifications',
'online-accounts', 'online-accounts',
'power', 'power',
@ -49,10 +27,10 @@ index 2f4fdc5e3..7113a9867 100644
'removable-media', 'removable-media',
'search', 'search',
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index f20384394..9c329a477 100644 index 67f3f1b46..48c587066 100644
--- a/shell/cc-panel-loader.c --- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c +++ b/shell/cc-panel-loader.c
@@ -50,7 +50,6 @@ extern GType cc_wifi_panel_get_type (void); @@ -51,7 +51,6 @@ extern GType cc_wifi_panel_get_type (void);
extern GType cc_notifications_panel_get_type (void); extern GType cc_notifications_panel_get_type (void);
extern GType cc_goa_panel_get_type (void); extern GType cc_goa_panel_get_type (void);
extern GType cc_power_panel_get_type (void); extern GType cc_power_panel_get_type (void);
@ -60,7 +38,7 @@ index f20384394..9c329a477 100644
extern GType cc_region_panel_get_type (void); extern GType cc_region_panel_get_type (void);
extern GType cc_removable_media_panel_get_type (void); extern GType cc_removable_media_panel_get_type (void);
extern GType cc_search_panel_get_type (void); extern GType cc_search_panel_get_type (void);
@@ -114,7 +113,6 @@ static CcPanelLoaderVtable default_panels[] = @@ -122,7 +121,6 @@ static CcPanelLoaderVtable default_panels[] =
PANEL_TYPE("notifications", cc_notifications_panel_get_type, NULL), PANEL_TYPE("notifications", cc_notifications_panel_get_type, NULL),
PANEL_TYPE("online-accounts", cc_goa_panel_get_type, NULL), PANEL_TYPE("online-accounts", cc_goa_panel_get_type, NULL),
PANEL_TYPE("power", cc_power_panel_get_type, NULL), PANEL_TYPE("power", cc_power_panel_get_type, NULL),
@ -79,5 +57,5 @@ index d4fe361ef..01f7c923c 100644
-subdir('printers') -subdir('printers')
subdir('info') subdir('info')
-- --
2.17.1 2.25.1

View file

@ -0,0 +1,87 @@
From ef5c92ca97770fe2e970985a499d8c1a4749be5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 24 Aug 2021 18:23:51 +0200
Subject: [PATCH 2/8] shell: Mirror the main leaflet's 'folded' property
This makes it simpler for panels to check whether g-c-c
is in folded state.
---
shell/cc-window.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/shell/cc-window.c b/shell/cc-window.c
index de4eccc04..c9a7bf0b0 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -81,6 +81,8 @@ struct _CcWindow
CcPanel *active_panel;
GSettings *settings;
+ gboolean folded;
+
CcPanelListView previous_list_view;
};
@@ -93,7 +95,8 @@ enum
{
PROP_0,
PROP_ACTIVE_PANEL,
- PROP_MODEL
+ PROP_MODEL,
+ PROP_FOLDED,
};
/* Auxiliary methods */
@@ -766,6 +769,10 @@ cc_window_get_property (GObject *object,
g_value_set_object (value, self->store);
break;
+ case PROP_FOLDED:
+ g_value_set_boolean (value, self->folded);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -790,6 +797,10 @@ cc_window_set_property (GObject *object,
self->store = g_value_dup_object (value);
break;
+ case PROP_FOLDED:
+ self->folded = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -876,6 +887,14 @@ cc_window_class_init (CcWindowClass *klass)
CC_TYPE_SHELL_MODEL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (object_class,
+ PROP_FOLDED,
+ g_param_spec_boolean ("folded",
+ "Folded",
+ "Whether the window is foled",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/ControlCenter/gtk/cc-window.ui");
gtk_widget_class_bind_template_child (widget_class, CcWindow, back_revealer);
@@ -921,6 +940,12 @@ cc_window_init (CcWindow *self)
self->previous_panels = g_queue_new ();
self->previous_list_view = cc_panel_list_get_view (self->panel_list);
+ g_object_bind_property (self->main_leaflet,
+ "folded",
+ self,
+ "folded",
+ G_BINDING_SYNC_CREATE);
+
/* Add a custom CSS class on development builds */
if (in_flatpak_sandbox ())
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)), "devel");
--
2.25.1

View file

@ -0,0 +1,210 @@
From c8cf47d9f6873aa996d29283055e110389250434 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@sigxcpu.org>
Date: Tue, 24 Aug 2021 18:25:05 +0200
Subject: [PATCH 3/8] display: Use ComboBox when folded
On small window sizes the ButtonBox can overflow the panel. This is
especially true in single display mode when no other elemnts prevent
shrinking to e.g. 360px width on phones. Use the ComboBox introduced in
632cb3c907922d4449e5758d218612ad5d8735c6 in these cases.
For that we introduce cc_display_settings_refresh_layout() to refresh
the layout when the folded state changes. This can later on be used for
more tweaks to shrink to smaller sizes.
---
panels/display/cc-display-panel.c | 19 ++++++-
panels/display/cc-display-settings.c | 84 +++++++++++++++-------------
panels/display/cc-display-settings.h | 2 +
3 files changed, 65 insertions(+), 40 deletions(-)
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index f9d4ae044..91b3f3387 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -457,6 +457,7 @@ static void
cc_display_panel_dispose (GObject *object)
{
CcDisplayPanel *self = CC_DISPLAY_PANEL (object);
+ GtkWidget *toplevel = cc_shell_get_toplevel (cc_panel_get_shell (CC_PANEL (self)));
reset_titlebar (CC_DISPLAY_PANEL (object));
@@ -474,6 +475,8 @@ cc_display_panel_dispose (GObject *object)
g_clear_pointer ((GtkWidget **) &self->night_light_dialog, gtk_widget_destroy);
+ g_signal_handlers_disconnect_by_data (toplevel, self);
+
G_OBJECT_CLASS (cc_display_panel_parent_class)->dispose (object);
}
@@ -645,12 +648,26 @@ on_primary_display_selected_index_changed_cb (CcDisplayPanel *panel)
update_apply_button (panel);
}
+static void
+on_toplevel_folded (CcDisplayPanel *panel, GParamSpec *pspec, GtkWidget *toplevel)
+{
+ gboolean folded;
+
+ g_object_get (toplevel, "folded", &folded, NULL);
+ cc_display_settings_refresh_layout (panel->settings, folded);
+}
+
static void
cc_display_panel_constructed (GObject *object)
{
+ GtkWidget *toplevel = cc_shell_get_toplevel (cc_panel_get_shell (CC_PANEL (object)));
+
g_signal_connect_object (cc_panel_get_shell (CC_PANEL (object)), "notify::active-panel",
G_CALLBACK (active_panel_changed), object, G_CONNECT_SWAPPED);
+ g_signal_connect_swapped (toplevel, "notify::folded", G_CALLBACK (on_toplevel_folded), object);
+ on_toplevel_folded (CC_DISPLAY_PANEL (object), NULL, toplevel);
+
G_OBJECT_CLASS (cc_display_panel_parent_class)->constructed (object);
}
@@ -928,7 +945,7 @@ reset_current_config (CcDisplayPanel *panel)
if (!current)
return;
-
+
cc_display_config_set_minimum_size (current, MINIMUM_WIDTH, MINIMUM_HEIGHT);
panel->current_config = current;
diff --git a/panels/display/cc-display-settings.c b/panels/display/cc-display-settings.c
index a4f914ecd..efda19473 100644
--- a/panels/display/cc-display-settings.c
+++ b/panels/display/cc-display-settings.c
@@ -35,6 +35,8 @@ struct _CcDisplaySettings
GtkDrawingArea object;
gboolean updating;
+ gboolean num_scales;
+ gboolean folded;
guint idle_udpate_id;
gboolean has_accelerometer;
@@ -393,57 +395,49 @@ cc_display_settings_rebuild_ui (CcDisplaySettings *self)
/* Scale row is usually shown. */
gtk_container_foreach (GTK_CONTAINER (self->scale_bbox), (GtkCallback) gtk_widget_destroy, NULL);
g_list_store_remove_all (self->scale_list);
- gtk_widget_set_visible (self->scale_buttons_row, FALSE);
- gtk_widget_set_visible (self->scale_combo_row, FALSE);
scales = cc_display_mode_get_supported_scales (current_mode);
+ self->num_scales = scales->len;
for (i = 0; i < scales->len; i++)
{
g_autofree gchar *scale_str = NULL;
+ g_autoptr(HdyValueObject) value_object = NULL;
double scale = g_array_index (scales, double, i);
+ GtkWidget *scale_btn;
gboolean is_selected;
+ /* ComboRow */
scale_str = make_scale_string (scale);
is_selected = G_APPROX_VALUE (cc_display_monitor_get_scale (self->selected_output),
scale, DBL_EPSILON);
- if (scales->len > MAX_SCALE_BUTTONS)
- {
- g_autoptr(HdyValueObject) value_object = NULL;
-
- value_object = hdy_value_object_new_collect (G_TYPE_STRING, scale_str);
- g_list_store_append (self->scale_list, value_object);
- g_object_set_data_full (G_OBJECT (value_object), "scale",
- g_memdup2 (&scale, sizeof (double)), g_free);
- if (is_selected)
- hdy_combo_row_set_selected_index (HDY_COMBO_ROW (self->scale_combo_row),
- g_list_model_get_n_items (G_LIST_MODEL (self->scale_list)) - 1);
- }
- else
- {
- GtkWidget *scale_btn = gtk_radio_button_new_with_label_from_widget (group, scale_str);
- g_object_set_data_full (G_OBJECT (scale_btn), "scale",
- g_memdup2 (&scale, sizeof (double)), g_free);
-
- if (!group)
- group = GTK_RADIO_BUTTON (scale_btn);
- gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (scale_btn), FALSE);
- gtk_widget_show (scale_btn);
- gtk_container_add (GTK_CONTAINER (self->scale_bbox), scale_btn);
- /* Set active before connecting the signal */
- if (is_selected)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scale_btn), TRUE);
-
- g_signal_connect_object (scale_btn,
- "notify::active",
- G_CALLBACK (on_scale_btn_active_changed_cb),
- self, 0);
- }
+ value_object = hdy_value_object_new_collect (G_TYPE_STRING, scale_str);
+ g_list_store_append (self->scale_list, value_object);
+ g_object_set_data_full (G_OBJECT (value_object), "scale",
+ g_memdup2 (&scale, sizeof (double)), g_free);
+ if (is_selected)
+ hdy_combo_row_set_selected_index (HDY_COMBO_ROW (self->scale_combo_row),
+ g_list_model_get_n_items (G_LIST_MODEL (self->scale_list)) - 1);
+
+ /* ButtonBox */
+ scale_btn = gtk_radio_button_new_with_label_from_widget (group, scale_str);
+ g_object_set_data_full (G_OBJECT (scale_btn), "scale",
+ g_memdup2 (&scale, sizeof (double)), g_free);
+
+ if (!group)
+ group = GTK_RADIO_BUTTON (scale_btn);
+ gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (scale_btn), FALSE);
+ gtk_widget_show (scale_btn);
+ gtk_container_add (GTK_CONTAINER (self->scale_bbox), scale_btn);
+ /* Set active before connecting the signal */
+ if (is_selected)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scale_btn), TRUE);
+
+ g_signal_connect_object (scale_btn,
+ "notify::active",
+ G_CALLBACK (on_scale_btn_active_changed_cb),
+ self, 0);
}
-
- if (scales->len > MAX_SCALE_BUTTONS)
- gtk_widget_set_visible (self->scale_combo_row, TRUE);
- else
- gtk_widget_set_visible (self->scale_buttons_row, scales->len > 1);
+ cc_display_settings_refresh_layout (self, self->folded);
gtk_widget_set_visible (self->underscanning_row,
cc_display_monitor_supports_underscanning (self->selected_output) &&
@@ -843,3 +837,15 @@ cc_display_settings_set_selected_output (CcDisplaySettings *self,
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SELECTED_OUTPUT]);
}
+void
+cc_display_settings_refresh_layout (CcDisplaySettings *self,
+ gboolean folded)
+{
+ gboolean use_combo;
+
+ self->folded = folded;
+ use_combo = self->num_scales > MAX_SCALE_BUTTONS || (self->num_scales > 2 && folded);
+
+ gtk_widget_set_visible (self->scale_combo_row, use_combo);
+ gtk_widget_set_visible (self->scale_buttons_row, self->num_scales > 1 && !use_combo);
+}
diff --git a/panels/display/cc-display-settings.h b/panels/display/cc-display-settings.h
index 58709ddf7..de3c88d48 100644
--- a/panels/display/cc-display-settings.h
+++ b/panels/display/cc-display-settings.h
@@ -39,6 +39,8 @@ void cc_display_settings_set_config (CcDisplaySettings
CcDisplayMonitor* cc_display_settings_get_selected_output (CcDisplaySettings *settings);
void cc_display_settings_set_selected_output (CcDisplaySettings *settings,
CcDisplayMonitor *output);
+void cc_display_settings_refresh_layout (CcDisplaySettings *settings,
+ gboolean folded);
G_END_DECLS
--
2.25.1

View file

@ -0,0 +1,58 @@
From 81bb6daebef02481f6bc467a64d1402c598627dd Mon Sep 17 00:00:00 2001
From: undef <gitlab@undef.tools>
Date: Tue, 21 Sep 2021 08:56:22 +0000
Subject: [PATCH 4/8] Wrap long labels on small screens
Both the keyboard and region panels contain long GtkLabels. These labels
cause gnome-control-center overflow the screen, especially on small
screens like those on phones.
From https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1057
---
panels/keyboard/cc-keyboard-panel.ui | 2 ++
panels/region/cc-region-panel.ui | 2 ++
2 files changed, 4 insertions(+)
diff --git a/panels/keyboard/cc-keyboard-panel.ui b/panels/keyboard/cc-keyboard-panel.ui
index 9b0952e88..b8e8194d9 100644
--- a/panels/keyboard/cc-keyboard-panel.ui
+++ b/panels/keyboard/cc-keyboard-panel.ui
@@ -128,6 +128,7 @@
<property name="visible">True</property>
<property name="margin_left">6</property>
<property name="use_underline">True</property>
+ <property name="wrap">True</property>
<property name="label" translatable="yes">Use the _same source for all windows</property>
</object>
</child>
@@ -155,6 +156,7 @@
<property name="visible">True</property>
<property name="margin_left">6</property>
<property name="use_underline">True</property>
+ <property name="wrap">True</property>
<property name="label" translatable="yes">Switch input sources _individually for each window</property>
</object>
</child>
diff --git a/panels/region/cc-region-panel.ui b/panels/region/cc-region-panel.ui
index fc698f0af..d3a4801fb 100644
--- a/panels/region/cc-region-panel.ui
+++ b/panels/region/cc-region-panel.ui
@@ -86,6 +86,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
+ <property name="wrap">True</property>
<property name="label" translatable="yes">The language used for text in windows and web pages.</property>
<style>
<class name="dim-label"/>
@@ -211,6 +212,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
+ <property name="wrap">True</property>
<property name="label" translatable="yes">The format used for numbers, dates, and currencies.</property>
<style>
<class name="dim-label"/>
--
2.25.1

View file

@ -0,0 +1,48 @@
From 73c0b7f78f49f1503a6dc16517f3ecefddc59ee7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Sun, 3 Oct 2021 17:48:29 +0200
Subject: [PATCH 5/8] WiFi: Reduce width of connection row for mobile
The current WiFi panel is not adaptive on small screens. This results in
the panel being partially off the screen, blocking users from (for
example) editing connection settings.
This patch was developed for Mobian to shrink the minimum required space
for each connection row and the Airplane mode toggle. This allows the
panel to be used on thin screens.
Adapted from https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1029
to avoid modifying strings and breaking translations
---
panels/common/cc-list-row.ui | 1 +
panels/network/cc-wifi-connection-row.ui | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/panels/common/cc-list-row.ui b/panels/common/cc-list-row.ui
index 730b8d91a..ce14e7945 100644
--- a/panels/common/cc-list-row.ui
+++ b/panels/common/cc-list-row.ui
@@ -30,6 +30,7 @@
<property name="visible">0</property>
<property name="hexpand">1</property>
<property name="xalign">0.0</property>
+ <property name="wrap">True</property>
<property name="wrap-mode">word</property>
<property name="max-width-chars">42</property>
<style>
diff --git a/panels/network/cc-wifi-connection-row.ui b/panels/network/cc-wifi-connection-row.ui
index 39bb6db8b..dd8a90ac0 100644
--- a/panels/network/cc-wifi-connection-row.ui
+++ b/panels/network/cc-wifi-connection-row.ui
@@ -65,7 +65,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_end">6</property>
- <property name="label" translatable="yes">Connected</property>
+ <property name="label" translatable="no">✓</property>
<style>
<class name="dim-label"/>
</style>
--
2.25.1

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,62 @@
From d1d39a439448cd070c0d85ad5eb39d021db6ac69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Sun, 3 Oct 2021 17:56:45 +0200
Subject: [PATCH 7/8] Wifi: Use Purism connection editor
Build for adaptability.
Based on
https://source.puri.sm/pureos/packages/gnome-control-center/-/blob/pureos/master/debian/patches/pureos/Add-helper-for-new-connection-editor.patch
and
https://source.puri.sm/pureos/packages/gnome-control-center/-/blob/pureos/master/debian/patches/pureos/wifi-Use-new-connection-editor.patch
avoiding conditional use depending on Phosh.
---
panels/network/net-device-wifi.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/panels/network/net-device-wifi.c b/panels/network/net-device-wifi.c
index 69fe2e122..e9be21889 100644
--- a/panels/network/net-device-wifi.c
+++ b/panels/network/net-device-wifi.c
@@ -36,7 +36,7 @@
#include "panel-common.h"
#include "cc-list-row.h"
-#include "connection-editor/net-connection-editor.h"
+#include "connection-editor/cc-connection-editor.h"
#include "net-device-wifi.h"
#include "cc-wifi-connection-list.h"
@@ -967,14 +967,25 @@ show_details_for_row (NetDeviceWifi *self, CcWifiConnectionRow *row, CcWifiConne
{
NMConnection *connection;
NMAccessPoint *ap;
- NetConnectionEditor *editor;
+ CcConnectionEditor *new_editor;
connection = cc_wifi_connection_row_get_connection (row);
ap = cc_wifi_connection_row_best_access_point (row);
- editor = net_connection_editor_new (connection, self->device, ap, self->client);
- gtk_window_set_transient_for (GTK_WINDOW (editor), GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (row))));
- gtk_window_present (GTK_WINDOW (editor));
+ new_editor = g_object_get_data (G_OBJECT (self), "network-editor");
+ if (!new_editor) {
+ GtkWindow *parent;
+
+ parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (row)));
+ new_editor = CC_CONNECTION_EDITOR (cc_connection_editor_new (parent, self->client));
+ g_object_set_data (G_OBJECT (self), "network-editor", new_editor);
+ }
+
+ cc_connection_editor_set_connection (new_editor, connection, self->device);
+ cc_connection_editor_set_ap (new_editor, ap);
+
+ gtk_dialog_run (GTK_DIALOG (new_editor));
+ gtk_widget_hide (GTK_WIDGET (new_editor));
}
static void
--
2.25.1

View file

@ -0,0 +1,246 @@
From f9a3d824d401754805bb7102713facf82bcf39b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
Date: Sun, 3 Oct 2021 18:13:38 +0200
Subject: [PATCH 8/8] Users: Adapt panel to make it usable in small screens
---
panels/common/cc-permission-infobar.ui | 6 ++++++
panels/user-accounts/cc-add-user-dialog.ui | 22 +++++++---------------
panels/user-accounts/cc-password-dialog.ui | 15 ++++++++-------
3 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/panels/common/cc-permission-infobar.ui b/panels/common/cc-permission-infobar.ui
index 770765e08..e77e759b4 100644
--- a/panels/common/cc-permission-infobar.ui
+++ b/panels/common/cc-permission-infobar.ui
@@ -44,6 +44,9 @@
<property name="halign">start</property>
<!-- Actual string set in code -->
<property name="label"></property>
+ <property name="justify">center</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">word</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -54,6 +57,9 @@
<property name="visible">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Some settings must be unlocked before they can be changed.</property>
+ <property name="justify">center</property>
+ <property name="wrap">True</property>
+ <property name="wrap-mode">word</property>
</object>
</child>
</object>
diff --git a/panels/user-accounts/cc-add-user-dialog.ui b/panels/user-accounts/cc-add-user-dialog.ui
index 12a253ac4..2db2031e0 100644
--- a/panels/user-accounts/cc-add-user-dialog.ui
+++ b/panels/user-accounts/cc-add-user-dialog.ui
@@ -121,7 +121,7 @@
<property name="yalign">0</property>
<property name="xalign">0</property>
<property name="label"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="height-request">50</property>
<property name="wrap">True</property>
@@ -146,7 +146,6 @@
<property name="label" translatable="yes">_Username</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">local_username_combo</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -180,7 +179,6 @@
<property name="label" translatable="yes">_Full Name</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">local_name_entry</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -232,7 +230,6 @@
<property name="label" translatable="yes">Account _Type</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">local_account_type_box</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -249,7 +246,6 @@
<property name="label" translatable="yes">Password</property>
<property name="margin_top">12</property>
<property name="halign">start</property>
- <property name="margin_start">20</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -263,7 +259,6 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="margin_start">20</property>
<child>
<object class="GtkRadioButton" id="local_password_login_radio">
<property name="label" translatable="yes">Allow user to set a password when they next _login</property>
@@ -310,7 +305,6 @@
<property name="label" translatable="yes">_Password</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">local_password_entry</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -377,7 +371,7 @@
<property name="yalign">0</property>
<property name="xalign">0</property>
<property name="label"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="height-request">50</property>
<property name="wrap">True</property>
@@ -405,7 +399,6 @@
<property name="label" translatable="yes">_Confirm</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">local_verify_entry</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -445,7 +438,7 @@
<property name="yalign">0</property>
<property name="xalign">0</property>
<property name="label"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
@@ -507,7 +500,6 @@
<property name="label" translatable="yes">_Domain</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">enterprise_domain_combo</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -527,7 +519,6 @@
<property name="label" translatable="yes">_Username</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">enterprise_login_entry</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -547,7 +538,6 @@
<property name="label" translatable="yes">_Password</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">enterprise_password_entry</property>
- <property name="margin_start">20</property>
<style>
<class name="dim-label"/>
</style>
@@ -566,7 +556,7 @@
<property name="yalign">0</property>
<property name="xalign">0</property>
<property name="label"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="height-request">50</property>
<property name="wrap">True</property>
@@ -616,7 +606,7 @@
<property name="yalign">0</property>
<property name="xalign">0</property>
<property name="label"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="height-request">50</property>
<property name="wrap">True</property>
@@ -751,6 +741,8 @@
<property name="label" translatable="yes">You must be online in order to add enterprise users.</property>
<property name="yalign">0</property>
<property name="justify">center</property>
+ <property name="wrap">True</property>
+ <property name="wrap_mode">word-char</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<attributes>
diff --git a/panels/user-accounts/cc-password-dialog.ui b/panels/user-accounts/cc-password-dialog.ui
index bfcc7585b..ed781c8e8 100644
--- a/panels/user-accounts/cc-password-dialog.ui
+++ b/panels/user-accounts/cc-password-dialog.ui
@@ -5,7 +5,7 @@
<template class="CcPasswordDialog" parent="GtkDialog">
<property name="border_width">6</property>
<property name="title" translatable="yes">Change Password</property>
- <property name="resizable">False</property>
+ <property name="resizable">True</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="icon_name">system-users</property>
@@ -45,6 +45,7 @@
<style>
<class name="text-button"/>
<class name="suggested-action"/>
+ <class name="default"/>
</style>
</object>
<packing>
@@ -96,7 +97,7 @@
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="height-request">50</property>
<property name="wrap">True</property>
@@ -121,7 +122,7 @@
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes"></property>
- <property name="width-chars">35</property>
+ <property name="width-chars">20</property>
<property name="max-width-chars">35</property>
<property name="wrap">True</property>
<property name="hexpand">True</property>
@@ -142,10 +143,10 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">_Confirm New Password</property>
+ <property name="label" translatable="yes">_Confirm</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">verify_entry</property>
- <property name="margin_start">25</property>
+ <property name="margin_start">12</property>
<style>
<class name="dim-label"/>
</style>
@@ -162,7 +163,7 @@
<property name="label" translatable="yes">_New Password</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">password_entry</property>
- <property name="margin_start">25</property>
+ <property name="margin_start">12</property>
<style>
<class name="dim-label"/>
</style>
@@ -216,7 +217,7 @@
<property name="label" translatable="yes">Current _Password</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">old_password_entry</property>
- <property name="margin_start">25</property>
+ <property name="margin_start">12</property>
<property name="margin_bottom">12</property>
<style>
<class name="dim-label"/>
--
2.25.1

View file

@ -1,12 +1,12 @@
# Forked from Alpine to apply Purism's mobile patches # Forked from Alpine to apply adaptability patches
pkgname=gnome-control-center pkgname=gnome-control-center
pkgver=9999_git20210710 pkgver=9999_git20210917
pkgrel=0 pkgrel=0
_commit="30480740e4e5c0ab2920dc21859c34cbd41df278" _pkgver=41.1
pkgdesc="GNOME control center" pkgdesc="GNOME control center"
url="https://gitlab.gnome.org/GNOME/gnome-control-center" url="https://gitlab.gnome.org/GNOME/gnome-control-center"
# limited by gnome-online-accounts # s390x, mips64 and riscv64 blocked by polkit
arch="all !s390x !mips !mips64" arch="all !s390x !mips64 !riscv64"
license="GPL-2.0-or-later" license="GPL-2.0-or-later"
depends="cups-pk-helper openrc-settingsd dbus:org.freedesktop.Secrets" depends="cups-pk-helper openrc-settingsd dbus:org.freedesktop.Secrets"
makedepends=" makedepends="
@ -44,29 +44,48 @@ makedepends="
ibus-dev" ibus-dev"
options="!check" # needs unpackaged py-dbusmock options="!check" # needs unpackaged py-dbusmock
install="$pkgname.pre-install $pkgname.pre-upgrade" install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="$pkgname-dev $pkgname-lang $pkgname-dbg $pkgname-doc $pkgname-bash-completion" subpackages="$pkgname-dbg $pkgname-dev $pkgname-lang $pkgname-doc $pkgname-bash-completion"
source="https://source.puri.sm/pureos/packages/gnome-control-center/-/archive/$_commit/gnome-control-center-$_commit.tar.gz
_assets_location="https://gitlab.com/pabloyoyoista/g-c-c-assets/-/raw/master"
_purism_commit="d2c36cb86195d75a6975bc3ad369ee7a0a8f1352"
_purism_patches="https://source.puri.sm/pureos/packages/gnome-control-center/-/raw/$_purism_commit/debian/patches"
source="https://download.gnome.org/sources/gnome-control-center/${_pkgver%.*}/gnome-control-center-$_pkgver.tar.xz
0001-Hide-and-disable-building-printer-panel.patch 0001-Hide-and-disable-building-printer-panel.patch
0002-shell-Mirror-the-main-leaflet-s-folded-property.patch
0003-display-Use-ComboBox-when-folded.patch
0004-Wrap-long-labels-on-small-screens.patch
0005-WiFi-Reduce-width-of-connection-row-for-mobile.patch
0006-Add-new-connection-editor.patch
0007-Wifi-Use-Purism-connection-editor.patch
0008-Users-Adapt-panel-to-make-it-usable-in-small-screens.patch
$_assets_location/multitasking/active-screen-edges.svg
$_assets_location/multitasking/hot-corner.svg
$_assets_location/multitasking/workspaces-primary-display.svg
$_assets_location/multitasking/workspaces-span-displays.svg
$_purism_patches/pureos/avatar-chooser-Adapt-to-work-on-librem5.patch
$_purism_patches/pureos/datetime-Fix-timezone-selection-map.patch
$_purism_patches/pureos/display-Request-a-smaller-size-for-arrangment-widget.patch
$_purism_patches/pureos/online-accounts-Make-edit-account-dialog-resizable.patch
$_purism_patches/pureos/sound-fix-test-dialog-on-small-screen.patch
$_purism_patches/pureos/wifi-Fix-a-crash-when-wifi-device-is-removed.patch
README.alpine README.alpine
" "
builddir="$srcdir/$pkgname-$_commit"
builddir="$srcdir/$pkgname-$_pkgver"
prepare() { prepare() {
default_prepare default_prepare
patch_dir="$builddir"/debian/patches cp "$srcdir"/*.svg "$builddir"/panels/multitasking/assets
rm "$patch_dir"/distro-logo.patch
sed -i 's/^distro-logo.patch$//' "$patch_dir"/series
grep "\.patch$" debian/patches/series \
| xargs -I {} -t -r -n1 patch -p1 -i debian/patches/{}
} }
build() { build() {
abuild-meson \ abuild-meson \
-Dcheese=true \ -Dcheese=true \
-Dibus=true \ -Dibus=true \
. output . output
# Bad dep file -> blows up when compiling with multiple build jobs otherwise # Bad dep file -> blows up when compiling with multiple build jobs otherwise
ninja -C output panels/network/cc-network-resources.c ninja -C output panels/network/cc-network-resources.c
@ -90,7 +109,24 @@ package() {
} }
sha512sums=" sha512sums="
02a1fc03c1c4aaba74e49e0d59ef8ff4307ebd70e605164deed55cb6ba2c2d2c795dfdf6d4dcd8cc9da5e9dbbafac4ecf951faff43843b753c0bc7fc289ecd95 gnome-control-center-30480740e4e5c0ab2920dc21859c34cbd41df278.tar.gz 432cc9d90896f7d5ffc751cd6904e1694cf825e39807b00f673bf2a6b375ecb3d65de6602df49da0b3147c3a35c83f3177ab22ca68e7f66c530958afeab30bc5 gnome-control-center-41.1.tar.xz
b8954191d454e92386c42c9adacfdbb5126e347f5cb7014a2000112662f3af6a9b78219b575121f165377aef76be72389cdf5c5bb8b209878c16a18bddcc6732 0001-Hide-and-disable-building-printer-panel.patch b0e53a2a436acc7502dbe3c21df73ce7da042b4f1513b3e003d7f14bb23f308e67f32d1a5743e5b60800a3247c5f48e87479d7c1c8eeade25ae35fe43e088e6c 0001-Hide-and-disable-building-printer-panel.patch
7351f941110f369d3d9c837fcb52f91c8afaeb6e1a372de789584869bd9eb1d26c72ea65ea75fd1b14cecc8dc4baef060ec38b52d0c3bc46080732b38df26290 0002-shell-Mirror-the-main-leaflet-s-folded-property.patch
832da3134cdfb7a693088fe9b7579d5dc9788636163ec0fa8957803ff07bdc0c2b0a08fe7997fdf57a9d336cabd3cddc944074cca42154ed674bce6f01b5e163 0003-display-Use-ComboBox-when-folded.patch
a7d912c6e4a2aab0ba20e04240ee8e7a6729bee328249a1b7c123fa9bd2ee51685b29817538b81ec6bd5e1eee1966923893ca0fb9189eaa8dad401927a3746ed 0004-Wrap-long-labels-on-small-screens.patch
e8c0f1e03013ba95e80e65d790ea3eec3c47860a783bc6b0772a6607e90a37017da52a4308d78ec1755df740c798af744dac896fb74e690abf068a3e560a20d4 0005-WiFi-Reduce-width-of-connection-row-for-mobile.patch
8ed6b4c90a645e31b24e65a312b63f74d839a9a0f94509c7bf7206b355d326969203b20ddd3d1dc03a30f5294698899eaa42aa7301f166fab451ffc91bb59673 0006-Add-new-connection-editor.patch
9573434124562643299bcc7a2d2bf1f9b7a6f4efc30aa7605017553503c301efa062399409eefa07e5df4ea5be2d4396b7edfcf69828f2ca188d25fbae0dbcb9 0007-Wifi-Use-Purism-connection-editor.patch
ca8f9d85043682311c29352f21d4c1270b28d1a13135cb4189bb26d785bb255a37f70ba6a84d857d87febfc7a82344304ebb5e954411406f38126e8b0c1492fa 0008-Users-Adapt-panel-to-make-it-usable-in-small-screens.patch
a14d99eb128b04d6c1744c5599cb88a78c26c6aaa5a02b00970095c1107dbac9002dd985c9d0ef313bea13db79ed6bd672f247f00d4fb3c31b7dc1e9565627da active-screen-edges.svg
4ccc3cbce817381e0780f518ab8e6877f8169ad0ffefb89ae331703be5c4630f5f533ef73a978b093f0f4a0005b488aaf0bd637db11f5efacd5e0fe8c703d863 hot-corner.svg
6d17793ceb312ec9b3bf32c5ace90c0515aa874ed654ab0a18fa822bfc3c5fdfbfc6e752eb3c6e43f2abfbfd61c1e8ee6eca61fa721e8503a19a061a748c69ae workspaces-primary-display.svg
49fd807338e6d47e7f59cc592dd859c8fb93f73b0c035827f6d1c4f877afcca72aa24068adacf025f9f8c13d35ae8090bcc9a0f06a760915c53453cae870f20f workspaces-span-displays.svg
d7475a4d021ccaec1b380484cc045fba5ae43e36460bcba8f940fced3690148377f58e78fd57b7de0e3675671246dc4f28dc1611e2f2c1cdaf51495ee8ddb3d5 avatar-chooser-Adapt-to-work-on-librem5.patch
3c49081f364033d1d84a4b7594c39940da6f33d0eff2000ec04aea7f590876cf1a586dad4de9cb34f1bbb2e778a137bc5e38ecb9fa9c6121e1fa1ce21f74298f datetime-Fix-timezone-selection-map.patch
b07796c5d5424fe26f3c773750bd248b60a30d9ccccd7976fbf2626732216eb2a5813497c90f8c7a29074531cf5378cddb7cec4809df221ec9214f3191214b0a display-Request-a-smaller-size-for-arrangment-widget.patch
a4f34dfb11d676503991d5feb79f0f0551d5c067ce669091b195ac44518a09349db0178d3e7c13dfd5080acdfb24e2515f86c50c3d67fd15015ce20951ff9889 online-accounts-Make-edit-account-dialog-resizable.patch
24cc550021ba7fe7103d031411a2cc50f6d8b9522d37d19a84133a3da0a032a2c7b5a711f730bbd77c50a7ea7ff67fabb12ffecd15622094af39de802e576c86 sound-fix-test-dialog-on-small-screen.patch
6cce02774a0e755c9cd55af5a3baf4cc16f5e8c125cd6d83980dcfd9e7eabe0e884fa2a797d43f9741eb795e71fed7169b93e02bdd315aa96c0bedb5b42f0a50 wifi-Fix-a-crash-when-wifi-device-is-removed.patch
350aa443149c71851ad4de0976c7fc5cb626ba0c57a8d41e6ef80da1c65ed84a4dfa2483ae92630a3b611c4bfa9360ded82b55e8cd0e3907294c025e4f6b1671 README.alpine 350aa443149c71851ad4de0976c7fc5cb626ba0c57a8d41e6ef80da1c65ed84a4dfa2483ae92630a3b611c4bfa9360ded82b55e8cd0e3907294c025e4f6b1671 README.alpine
" "