summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Davis <christopherdavis@gnome.org>2021-02-17 19:39:19 -0800
committerChristopher Davis <christopherdavis@gnome.org>2021-02-17 19:39:19 -0800
commitd8f6f2ec6f2e81de16e4f71446c8a8ce50c367bd (patch)
tree8ce69d42321e2362b08d69d6a5c04d48aa6e6563
parent59036c4f076ba4f7351791670ebaf32457435fc6 (diff)
downloadgnome-control-center-wip/cdavis/40-consistency.tar.gz
user-accounts: Use rounded lists and HdyPreferencesGroupwip/cdavis/40-consistency
-rw-r--r--panels/user-accounts/cc-user-panel.c14
-rw-r--r--panels/user-accounts/cc-user-panel.ui36
2 files changed, 11 insertions, 39 deletions
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index ee9a8290f..be4743b61 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -32,6 +32,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <libhandy-1/handy.h>
#include <polkit/polkit.h>
#include <act/act.h>
#include <cairo-gobject.h>
@@ -70,7 +71,7 @@ struct _CcUserPanel {
GSettings *login_screen_settings;
GtkBox *accounts_box;
- GtkBox *account_settings_box;
+ HdyPreferencesGroup *account_settings_group;
GtkListBox *account_settings_listbox;
GtkListBox *authentication_and_login_listbox;
GtkListBoxRow *account_type_row;
@@ -872,7 +873,7 @@ show_user (ActUser *user, CcUserPanel *self)
/* Do not show the "Account Type" option when there's a single user account. */
show = (self->other_accounts != 0);
- gtk_widget_set_visible (GTK_WIDGET (self->account_settings_box), show);
+ gtk_widget_set_visible (GTK_WIDGET (self->account_settings_group), show);
gtk_label_set_label (self->password_button_label, get_password_mode_text (user));
enable = act_user_is_local_account (user);
@@ -1498,13 +1499,6 @@ setup_main_window (CcUserPanel *self)
users_loaded (self);
else
g_signal_connect_object (self->um, "notify::is-loaded", G_CALLBACK (users_loaded), self, G_CONNECT_SWAPPED);
-
- gtk_list_box_set_header_func (self->account_settings_listbox,
- cc_list_box_update_header_func,
- NULL, NULL);
- gtk_list_box_set_header_func (self->authentication_and_login_listbox,
- cc_list_box_update_header_func,
- NULL, NULL);
}
static GSettings *
@@ -1608,7 +1602,7 @@ cc_user_panel_class_init (CcUserPanelClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/user-accounts/cc-user-panel.ui");
gtk_widget_class_bind_template_child (widget_class, CcUserPanel, accounts_box);
- gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_settings_box);
+ gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_settings_group);
gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_settings_listbox);
gtk_widget_class_bind_template_child (widget_class, CcUserPanel, authentication_and_login_listbox);
gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_type_row);
diff --git a/panels/user-accounts/cc-user-panel.ui b/panels/user-accounts/cc-user-panel.ui
index 814c02efd..290e46a90 100644
--- a/panels/user-accounts/cc-user-panel.ui
+++ b/panels/user-accounts/cc-user-panel.ui
@@ -235,27 +235,16 @@
</child>
<child>
- <object class="GtkBox" id="account_settings_box">
+ <object class="HdyPreferencesGroup" id="account_settings_group">
<property name="visible">True</property>
- <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
- <property name="spacing">10</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Account Settings</property>
- <property name="halign">GTK_ALIGN_START</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ <property name="title" translatable="yes">Account Settings</property>
<child>
<object class="GtkListBox" id="account_settings_listbox">
<property name="visible">True</property>
<property name="selection-mode">GTK_SELECTION_NONE</property>
<signal name="row-activated" handler="activate_row"/>
<style>
- <class name="frame"/>
+ <class name="content"/>
</style>
<child>
<object class="GtkListBoxRow" id="account_type_row">
@@ -441,28 +430,17 @@
</child>
<child>
- <object class="GtkBox" id="authentication_and_login_box">
+ <object class="HdyPreferencesGroup" id="authentication_and_login_group">
<property name="visible">True</property>
- <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
- <property name="spacing">10</property>
- <property name="margin-top">10</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Authentication &amp; Login</property>
- <property name="halign">GTK_ALIGN_START</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
+ <property name="title" translatable="yes">Authentication &amp; Login</property>
+ <property name="margin-top">12</property>
<child>
<object class="GtkListBox" id="authentication_and_login_listbox">
<property name="visible">True</property>
<property name="selection-mode">GTK_SELECTION_NONE</property>
<signal name="row-activated" handler="activate_row"/>
<style>
- <class name="frame"/>
+ <class name="content"/>
</style>
<child>
<object class="GtkListBoxRow" id="password_row">