diff options
Diffstat (limited to 'community/gnome-control-center/fix-user-back-panel.patch')
-rw-r--r-- | community/gnome-control-center/fix-user-back-panel.patch | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/community/gnome-control-center/fix-user-back-panel.patch b/community/gnome-control-center/fix-user-back-panel.patch deleted file mode 100644 index 26f88f655a0..00000000000 --- a/community/gnome-control-center/fix-user-back-panel.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 2f24858f0cfe830a1fc168ccc0033d4b7091cbbd Mon Sep 17 00:00:00 2001 -From: Mpho Jele <mphokjele@gmail.com> -Date: Sun, 19 Jun 2022 16:45:45 +0200 -Subject: [PATCH 1/2] user-accounts: Show the back button when window leaflet - folds - -Currently the back button is only shown when viewing a user from the -"other users" list. -These changes show the back button when the window AdwLeaflet is -folded or when the selected is from the "other users" list but never -when the window is not folded and the selected user is the current -user. - -Fixes: #1719 ---- - panels/user-accounts/cc-user-panel.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c -index d2481a48f..244ce71e9 100644 ---- a/panels/user-accounts/cc-user-panel.c -+++ b/panels/user-accounts/cc-user-panel.c -@@ -789,6 +789,19 @@ update_fingerprint_row_state (CcUserPanel *self, GParamSpec *spec, CcFingerprint - gtk_label_set_text (self->fingerprint_state_label, _("Disabled")); - } - -+static void -+show_or_hide_back_button (CcUserPanel *self) -+{ -+ gboolean show; -+ gboolean folded; -+ -+ g_object_get(self, "folded", &folded, NULL); -+ -+ show = folded || act_user_get_uid (self->selected_user) != getuid(); -+ -+ gtk_widget_set_visible (GTK_WIDGET (self->back_button), show); -+} -+ - static void - show_user (ActUser *user, CcUserPanel *self) - { -@@ -888,6 +901,7 @@ show_user (ActUser *user, CcUserPanel *self) - gtk_widget_set_visible (GTK_WIDGET (self->account_settings_box), !show); - gtk_widget_set_visible (GTK_WIDGET (self->remove_user_button), !show); - gtk_widget_set_visible (GTK_WIDGET (self->back_button), !show); -+ show_or_hide_back_button(self); - gtk_widget_set_visible (GTK_WIDGET (self->other_users), show); - - /* Last login: show when administrator or current user */ -@@ -1447,6 +1461,11 @@ cc_user_panel_init (CcUserPanel *self) - self->login_screen_settings = settings_or_null ("org.gnome.login-screen"); - - setup_main_window (self); -+ -+ g_signal_connect_swapped (self, -+ "notify::folded", -+ G_CALLBACK (show_or_hide_back_button), -+ self); - } - - static void --- -GitLab - - -From b1d99420d41a8cfd7f68f5325cbe68081d013148 Mon Sep 17 00:00:00 2001 -From: Mpho Jele <mphokjele@gmail.com> -Date: Sun, 19 Jun 2022 16:55:02 +0200 -Subject: [PATCH 2/2] user-accounts: Make back button switch to current user or - panels list - -When the window AdwLeaflet is folded the back button should either -switch to the panels list if the selected user is the current user -or switch to the current user if the selected user is from the -"other users" list ---- - panels/user-accounts/cc-user-panel.c | 17 ++++++++++++++++- - panels/user-accounts/cc-user-panel.ui | 2 +- - 2 files changed, 17 insertions(+), 2 deletions(-) - -diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c -index 244ce71e9..6b750d926 100644 ---- a/panels/user-accounts/cc-user-panel.c -+++ b/panels/user-accounts/cc-user-panel.c -@@ -185,6 +185,21 @@ show_current_user (CcUserPanel *self) - show_user (user, self); - } - -+ -+static void -+on_back_button_clicked_cb (CcUserPanel *self) -+{ -+ -+ if (act_user_get_uid (self->selected_user) == getuid ()) { -+ gtk_widget_activate_action (GTK_WIDGET (self), -+ "window.navigate", -+ "i", -+ ADW_NAVIGATION_DIRECTION_BACK); -+ } else { -+ show_current_user (self); -+ } -+} -+ - static const gchar * - get_real_or_user_name (ActUser *user) - { -@@ -1549,6 +1564,6 @@ cc_user_panel_class_init (CcUserPanelClass *klass) - gtk_widget_class_bind_template_callback (widget_class, dismiss_notification); - gtk_widget_class_bind_template_callback (widget_class, restart_now); - gtk_widget_class_bind_template_callback (widget_class, set_selected_user); -- gtk_widget_class_bind_template_callback (widget_class, show_current_user); -+ gtk_widget_class_bind_template_callback (widget_class, on_back_button_clicked_cb); - gtk_widget_class_bind_template_callback (widget_class, show_history); - } -diff --git a/panels/user-accounts/cc-user-panel.ui b/panels/user-accounts/cc-user-panel.ui -index ca65e7f70..7a578d8c0 100644 ---- a/panels/user-accounts/cc-user-panel.ui -+++ b/panels/user-accounts/cc-user-panel.ui -@@ -30,7 +30,7 @@ - <object class="GtkButton" id="back_button"> - <property name="visible">False</property> - <property name="icon-name">go-previous-symbolic</property> -- <signal name="clicked" handler="show_current_user" object="CcUserPanel" swapped="yes"/> -+ <signal name="clicked" handler="on_back_button_clicked_cb" object="CcUserPanel" swapped="yes"/> - </object> - </child> - </object> --- -GitLab - |