[gnome-control-center/wip/feborges/user-accounts-ui-improvements] user-accounts: UI style improvements



commit 6e084d53bac4cbdba55dd554239404268724497e
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Jan 13 15:35:09 2020 +0100

    user-accounts: UI style improvements
    
    According to the mockups at
    https://gitlab.gnome.org/Teams/Design/settings-mockups/raw/master/users/users.png
    
    Fixes #771

 panels/user-accounts/cc-user-panel.c  | 191 ++++++-----
 panels/user-accounts/cc-user-panel.ui | 602 +++++++++++++++++-----------------
 2 files changed, 412 insertions(+), 381 deletions(-)
---
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index bc3ec8cc4..87f975888 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -65,31 +65,28 @@ struct _CcUserPanel {
         GSettings *login_screen_settings;
 
         GtkBox          *accounts_box;
-        GtkRadioButton  *account_type_admin_button;
-        GtkBox          *account_type_box;
-        GtkLabel        *account_type_label;
-        GtkRadioButton  *account_type_standard_button;
+        GtkListBox      *account_settings_listbox;
+        GtkListBox      *authentication_and_login_listbox;
+        GtkGrid         *account_type_row;
+        GtkSwitch       *account_type_switch;
         GtkButton       *add_user_button;
-        GtkBox          *autologin_box;
-        GtkLabel        *autologin_label;
+        GtkBox          *autologin_row;
         GtkSwitch       *autologin_switch;
         CcCarousel      *carousel;
         GtkButton       *fingerprint_button;
-        GtkLabel        *fingerprint_label;
+        GtkLabel        *fingerprint_row;
         GtkStack        *full_name_stack;
         GtkLabel        *full_name_label;
         GtkToggleButton *full_name_edit_button;
         GtkEntry        *full_name_entry;
-        GtkButton       *language_button;
         GtkLabel        *language_button_label;
-        GtkLabel        *language_label;
-        GtkButton       *last_login_button;
+        GtkBox          *language_row;
         GtkLabel        *last_login_button_label;
-        GtkLabel        *last_login_label;
+        GtkLabel        *last_login_row;
         GtkBox          *no_users_box;
         GtkRevealer     *notification_revealer;
-        GtkButton       *password_button;
         GtkLabel        *password_button_label;
+        GtkBox          *password_row;
         CcPermissionInfobar *permission_infobar;
         GtkButton       *remove_user_button;
         GtkStack        *stack;
@@ -794,6 +791,26 @@ get_autologin_possible (ActUser *user)
         return !(locked || set_password_at_login);
 }
 
+static void
+update_header_func (GtkListBoxRow *row, GtkListBoxRow *before, gpointer user_data)
+{
+        GtkWidget *current;
+        GtkWidget *child;
+
+        child = gtk_bin_get_child (GTK_BIN (row));
+        if (before == NULL || !gtk_widget_get_visible (child)) {
+                gtk_list_box_row_set_header (row, NULL);
+                return;
+        }
+
+        current = gtk_list_box_row_get_header (row);
+        if (current == NULL) {
+            current = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+            gtk_widget_show (current);
+            gtk_list_box_row_set_header (row, current);
+        }
+}
+
 static void on_permission_changed (CcUserPanel *self);
 
 static void
@@ -814,15 +831,12 @@ show_user (ActUser *user, CcUserPanel *self)
         gtk_entry_set_text (self->full_name_entry, act_user_get_real_name (user));
         gtk_widget_set_tooltip_text (GTK_WIDGET (self->full_name_edit_button), act_user_get_user_name 
(user));
 
-        if (act_user_get_account_type (user) == ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR)
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->account_type_admin_button), TRUE);
-        else
-                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->account_type_standard_button), TRUE);
+        gtk_switch_set_active (self->account_type_switch,
+                act_user_get_account_type (user) == ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR);
 
         /* 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_type_label), show);
-        gtk_widget_set_visible (GTK_WIDGET (self->account_type_box), show);
+        gtk_widget_set_visible (GTK_WIDGET (self->account_type_row), show);
 
         gtk_label_set_label (self->password_button_label, get_password_mode_text (user));
         enable = act_user_is_local_account (user);
@@ -852,18 +866,15 @@ show_user (ActUser *user, CcUserPanel *self)
                 (self->login_screen_settings &&
                  g_settings_get_boolean (self->login_screen_settings, "enable-fingerprint-authentication")) 
&&
                 set_fingerprint_label (self->fingerprint_button));
-        gtk_widget_set_visible (GTK_WIDGET (self->fingerprint_label), show);
-        gtk_widget_set_visible (GTK_WIDGET (self->fingerprint_button), show);
+        gtk_widget_set_visible (GTK_WIDGET (self->fingerprint_row), show);
 
         /* Autologin: show when local account */
         show = act_user_is_local_account (user);
-        gtk_widget_set_visible (GTK_WIDGET (self->autologin_box), show);
-        gtk_widget_set_visible (GTK_WIDGET (self->autologin_label), show);
+        gtk_widget_set_visible (GTK_WIDGET (self->autologin_row), show);
 
         /* Language: do not show for current user */
         show = act_user_get_uid (user) != getuid();
-        gtk_widget_set_visible (GTK_WIDGET (self->language_button), show);
-        gtk_widget_set_visible (GTK_WIDGET (self->language_label), show);
+        gtk_widget_set_visible (GTK_WIDGET (self->language_row), show);
 
         /* Last login: show when administrator or current user */
         current = act_user_manager_get_user_by_id (self->um, getuid ());
@@ -874,14 +885,21 @@ show_user (ActUser *user, CcUserPanel *self)
                 gtk_label_set_label (self->last_login_button_label, text);
                 g_free (text);
         }
-        gtk_widget_set_visible (GTK_WIDGET (self->last_login_button), show);
-        gtk_widget_set_visible (GTK_WIDGET (self->last_login_label), show);
+        gtk_widget_set_visible (GTK_WIDGET (self->last_login_row), show);
 
         enable = act_user_get_login_history (user) != NULL;
-        gtk_widget_set_sensitive (GTK_WIDGET (self->last_login_button), enable);
+        gtk_widget_set_sensitive (GTK_WIDGET (self->last_login_row), enable);
 
         if (self->permission != NULL)
                 on_permission_changed (self);
+
+        /* Let's make sure that the row's visibility is stable before we add separators. */
+        gtk_list_box_set_header_func (self->account_settings_listbox,
+                                      update_header_func,
+                                      NULL, NULL);
+        gtk_list_box_set_header_func (self->authentication_and_login_listbox,
+                                      update_header_func,
+                                      NULL, NULL);
 }
 
 static void
@@ -920,14 +938,15 @@ static void
 account_type_changed (CcUserPanel *self)
 {
         ActUser *user;
-        gint account_type;
         gboolean self_selected;
+        gboolean is_admin;
+        ActUserAccountType account_type;
 
         user = get_selected_user (self);
         self_selected = act_user_get_uid (user) == geteuid ();
+        is_admin = gtk_switch_get_active (self->account_type_switch);
 
-        account_type = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->account_type_standard_button)) 
?  ACT_USER_ACCOUNT_TYPE_STANDARD : ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR;
-
+        account_type = is_admin ? ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR : ACT_USER_ACCOUNT_TYPE_STANDARD;
         if (account_type != act_user_get_account_type (user)) {
                 act_user_set_account_type (user, account_type);
 
@@ -1094,6 +1113,33 @@ show_history (CcUserPanel *self)
         gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
+static void
+activate_row (GtkListBox *box, GtkListBoxRow *row, CcUserPanel *self)
+{
+        const gchar *widget_name;
+        GtkWidget *child = gtk_bin_get_child (GTK_BIN (row));
+        gboolean is_authorized = gtk_widget_get_sensitive (child);
+
+        widget_name = gtk_buildable_get_name (GTK_BUILDABLE (child));
+        if (widget_name == NULL)
+                return;
+
+        if (is_authorized && g_strcmp0 (widget_name, "language_row") == 0) {
+                change_language (self);
+                return;
+        }
+
+        if (is_authorized && g_strcmp0 (widget_name, "password_row") == 0) {
+                change_password (self);
+                return;
+        }
+
+        if (is_authorized && g_strcmp0 (widget_name, "last_login_row") == 0) {
+                show_history (self);
+                return;
+        }
+}
+
 static void
 users_loaded (CcUserPanel *self)
 {
@@ -1250,31 +1296,31 @@ on_permission_changed (CcUserPanel *self)
         }
 
         if (!act_user_is_local_account (user)) {
-                gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_box), FALSE);
-                remove_unlock_tooltip (GTK_WIDGET (self->account_type_box));
-                gtk_widget_set_sensitive (GTK_WIDGET (self->autologin_switch), FALSE);
-                remove_unlock_tooltip (GTK_WIDGET (self->autologin_switch));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_row), FALSE);
+                remove_unlock_tooltip (GTK_WIDGET (self->account_type_row));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->autologin_row), FALSE);
+                remove_unlock_tooltip (GTK_WIDGET (self->autologin_row));
 
         } else if (is_authorized && act_user_is_local_account (user)) {
                 if (would_demote_only_admin (user)) {
-                        gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_box), FALSE);
+                        gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_row), FALSE);
                 } else {
-                        gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_box), TRUE);
+                        gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_row), TRUE);
                 }
-                remove_unlock_tooltip (GTK_WIDGET (self->account_type_box));
+                remove_unlock_tooltip (GTK_WIDGET (self->account_type_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->autologin_switch), get_autologin_possible 
(user));
-                remove_unlock_tooltip (GTK_WIDGET (self->autologin_switch));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->autologin_row), get_autologin_possible (user));
+                remove_unlock_tooltip (GTK_WIDGET (self->autologin_row));
         }
         else {
-                gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_box), FALSE);
+                gtk_widget_set_sensitive (GTK_WIDGET (self->account_type_row), FALSE);
                 if (would_demote_only_admin (user)) {
-                        remove_unlock_tooltip (GTK_WIDGET (self->account_type_box));
+                        remove_unlock_tooltip (GTK_WIDGET (self->account_type_row));
                 } else {
-                        add_unlock_tooltip (GTK_WIDGET (self->account_type_box));
+                        add_unlock_tooltip (GTK_WIDGET (self->account_type_row));
                 }
-                gtk_widget_set_sensitive (GTK_WIDGET (self->autologin_switch), FALSE);
-                add_unlock_tooltip (GTK_WIDGET (self->autologin_switch));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->autologin_row), FALSE);
+                add_unlock_tooltip (GTK_WIDGET (self->autologin_row));
         }
 
         /* The full name entry: insensitive if remote or not authorized and not self */
@@ -1294,32 +1340,32 @@ on_permission_changed (CcUserPanel *self)
         if (is_authorized || self_selected) {
                 gtk_stack_set_visible_child (self->user_icon_stack, GTK_WIDGET (self->user_icon_button));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->language_button), TRUE);
-                remove_unlock_tooltip (GTK_WIDGET (self->language_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->language_row), TRUE);
+                remove_unlock_tooltip (GTK_WIDGET (self->language_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->password_button), TRUE);
-                remove_unlock_tooltip (GTK_WIDGET (self->password_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->password_row), TRUE);
+                remove_unlock_tooltip (GTK_WIDGET (self->password_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->fingerprint_button), TRUE);
-                remove_unlock_tooltip (GTK_WIDGET (self->fingerprint_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->fingerprint_row), TRUE);
+                remove_unlock_tooltip (GTK_WIDGET (self->fingerprint_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->last_login_button), TRUE);
-                remove_unlock_tooltip (GTK_WIDGET (self->last_login_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->last_login_row), TRUE);
+                remove_unlock_tooltip (GTK_WIDGET (self->last_login_row));
         }
         else {
                 gtk_stack_set_visible_child (self->user_icon_stack, GTK_WIDGET (self->user_icon_image));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->language_button), FALSE);
-                add_unlock_tooltip (GTK_WIDGET (self->language_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->language_row), FALSE);
+                add_unlock_tooltip (GTK_WIDGET (self->language_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->password_button), FALSE);
-                add_unlock_tooltip (GTK_WIDGET (self->password_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->password_row), FALSE);
+                add_unlock_tooltip (GTK_WIDGET (self->password_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->fingerprint_button), FALSE);
-                add_unlock_tooltip (GTK_WIDGET (self->fingerprint_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->fingerprint_row), FALSE);
+                add_unlock_tooltip (GTK_WIDGET (self->fingerprint_row));
 
-                gtk_widget_set_sensitive (GTK_WIDGET (self->last_login_button), FALSE);
-                add_unlock_tooltip (GTK_WIDGET (self->last_login_button));
+                gtk_widget_set_sensitive (GTK_WIDGET (self->last_login_row), FALSE);
+                add_unlock_tooltip (GTK_WIDGET (self->last_login_row));
         }
 }
 
@@ -1364,6 +1410,7 @@ 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);
+
 }
 
 static GSettings *
@@ -1470,31 +1517,28 @@ 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_type_admin_button);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_type_box);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_type_label);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_type_standard_button);
+        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);
+        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, account_type_switch);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, add_user_button);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, autologin_box);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, autologin_label);
+        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, autologin_row);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, autologin_switch);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, carousel);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, fingerprint_button);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, fingerprint_label);
+        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, fingerprint_row);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, full_name_stack);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, full_name_label);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, full_name_edit_button);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, full_name_entry);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, language_button);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, language_button_label);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, language_label);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, last_login_button);
+        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, language_row);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, last_login_button_label);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, last_login_label);
+        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, last_login_row);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, no_users_box);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, notification_revealer);
-        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, password_button);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, password_button_label);
+        gtk_widget_class_bind_template_child (widget_class, CcUserPanel, password_row);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, permission_infobar);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, remove_user_button);
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, stack);
@@ -1505,10 +1549,11 @@ cc_user_panel_class_init (CcUserPanelClass *klass)
         gtk_widget_class_bind_template_child (widget_class, CcUserPanel, users_overlay);
 
         gtk_widget_class_bind_template_callback (widget_class, account_type_changed);
+        gtk_widget_class_bind_template_callback (widget_class, activate_row);
         gtk_widget_class_bind_template_callback (widget_class, add_user);
         gtk_widget_class_bind_template_callback (widget_class, autologin_changed);
         gtk_widget_class_bind_template_callback (widget_class, change_fingerprint);
-        gtk_widget_class_bind_template_callback (widget_class, change_language);
+        //gtk_widget_class_bind_template_callback (widget_class, change_language);
         gtk_widget_class_bind_template_callback (widget_class, change_name_done);
         gtk_widget_class_bind_template_callback (widget_class, change_name_focus_out);
         gtk_widget_class_bind_template_callback (widget_class, change_password);
diff --git a/panels/user-accounts/cc-user-panel.ui b/panels/user-accounts/cc-user-panel.ui
index 5f3644e8b..406220881 100644
--- a/panels/user-accounts/cc-user-panel.ui
+++ b/panels/user-accounts/cc-user-panel.ui
@@ -102,89 +102,64 @@
                     <property name="expand">False</property>
                   </packing>
                 </child>
+
                 <child>
-                  <object class="GtkGrid">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="column_spacing">10</property>
-                    <property name="row_spacing">10</property>
-                    <property name="margin_top">40</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-end">12</property>
                     <property name="halign">GTK_ALIGN_CENTER</property>
-                    <property name="height_request">300</property>
-                    <child>
-                      <object class="GtkButton" id="fingerprint_button">
-                        <property name="visible">True</property>
-                        <property name="hexpand">True</property>
-                        <signal name="clicked" handler="change_fingerprint" object="CcUserPanel" 
swapped="yes"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">5</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
+                    <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
+                    <property name="spacing">10</property>
+                    <property name="margin-top">30</property>
+
                     <child>
-                      <object class="GtkBox" id="account_type_box">
+                      <object class="GtkBox">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="sensitive">False</property>
-                        <style>
-                          <class name="linked"/>
-                        </style>
-                        <child>
-                          <object class="GtkRadioButton" id="account_type_standard_button">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="label" translatable="yes">Standard</property>
-                            <property name="draw_indicator">False</property>
-                            <property name="hexpand">True</property>
-                            <signal name="toggled" handler="account_type_changed" object="CcUserPanel" 
swapped="yes"/>
-                          </object>
-                        </child>
+                        <property name="valign">GTK_ALIGN_CENTER</property>
+                        <property name="spacing">10</property>
+                        <property name="margin-top">10</property>
                         <child>
-                          <object class="GtkRadioButton" id="account_type_admin_button">
+                          <object class="GtkStack" id="user_icon_stack">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="label" translatable="yes">Administrator</property>
-                            <property name="draw_indicator">False</property>
-                            <property name="group">account_type_standard_button</property>
-                            <property name="hexpand">True</property>
+                            <property name="halign">GTK_ALIGN_END</property>
+                            <child>
+                              <object class="CcUserImage" id="user_icon_image">
+                                <property name="visible">True</property>
+                                <property name="icon_name">avatar-default</property>
+                                <property name="pixel_size">96</property>
+                                <property name="halign">GTK_ALIGN_END</property>
+                                <child internal-child="accessible">
+                                  <object class="AtkObject">
+                                    <property name="accessible-name" translatable="yes">User Icon</property>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkToggleButton" id="user_icon_button">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="relief">GTK_RELIEF_NORMAL</property>
+                                <style>
+                                  <class name="user-icon-button"/>
+                                </style>
+                                <child internal-child="accessible">
+                                  <object class="AtkObject">
+                                    <property name="accessible-name" translatable="yes">User Icon</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="CcUserImage" id="user_icon_image2">
+                                    <property name="visible">True</property>
+                                    <property name="icon_name">avatar-default</property>
+                                    <property name="pixel_size">96</property>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
                           </object>
                         </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="account_type_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Account _Type</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">account_type_box</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkBox">
-                        <property name="visible">True</property>
-                        <property name="valign">GTK_ALIGN_CENTER</property>
-                        <property name="spacing">10</property>
+
                         <child>
                           <object class="GtkStack" id="full_name_stack">
                             <property name="visible">True</property>
@@ -214,6 +189,7 @@
                         <child>
                           <object class="GtkToggleButton" id="full_name_edit_button">
                             <property name="visible">True</property>
+                            <property name="valign">GTK_ALIGN_CENTER</property>
                             <signal name="toggled" handler="full_name_edit_button_clicked" 
object="CcUserPanel" swapped="yes"/>
                             <style>
                               <class name="circular"/>
@@ -231,261 +207,290 @@
                           </packing>
                         </child>
                       </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="password_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Password</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">password_button</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">3</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
                     </child>
+
                     <child>
-                      <object class="GtkButton" id="password_button">
+                      <object class="GtkBox" id="account_settings_box">
                         <property name="visible">True</property>
-                        <property name="hexpand">True</property>
-                        <signal name="clicked" handler="change_password" object="CcUserPanel" swapped="yes"/>
-                        <style>
-                          <class name="text-button"/>
-                        </style>
+                        <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
+                        <property name="spacing">10</property>
                         <child>
-                          <object class="GtkLabel" id="password_button_label">
+                          <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>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">3</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="autologin_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">A_utomatic Login</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">autologin_switch</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">4</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkBox" id="autologin_box">
-                        <property name="visible">True</property>
-                        <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
                         <child>
-                          <object class="GtkSwitch" id="autologin_switch">
+                          <object class="GtkListBox" id="account_settings_listbox">
                             <property name="visible">True</property>
-                            <property name="valign">GTK_ALIGN_CENTER</property>
-                            <signal name="notify::active" handler="autologin_changed" object="CcUserPanel" 
swapped="yes"/>
+                            <property name="selection-mode">GTK_SELECTION_NONE</property>
+                            <signal name="row-activated" handler="activate_row"/>
+                            <style>
+                              <class name="frame"/>
+                            </style>
+                            <child>
+                              <object class="GtkGrid" id="account_type_row">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="sensitive">False</property>
+                                <property name="border-width">10</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="halign">GTK_ALIGN_START</property>
+                                    <property name="label" translatable="yes">_Administrator</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">account_type_switch</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkSwitch" id="account_type_switch">
+                                    <property name="visible">True</property>
+                                    <signal name="notify::active" handler="account_type_changed" 
object="CcUserPanel" swapped="yes"/>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="wrap">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="max-width-chars">48</property>
+                                    <property name="label" translatable="yes">Administrators can add and 
remove other users, and can change settings for all users.</property>
+                                    <attributes>
+                                      <attribute name="scale" value="0.9"/>
+                                    </attributes>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">0</property>
+                                    <property name="top_attach">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkBox" id="language_row">
+                                <property name="visible">True</property>
+                                <property name="border-width">10</property>
+                                <property name="spacing">10</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="label" translatable="yes">_Language</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">language_button_label</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkImage">
+                                    <property name="visible">True</property>
+                                    <property name="icon-name">go-next-symbolic</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="language_button_label">
+                                    <property name="visible">True</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
                           </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
                         </child>
                       </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">4</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="fingerprint_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Fingerprint Login</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">fingerprint_button</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">5</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
                     </child>
+
                     <child>
-                      <object class="GtkStack" id="user_icon_stack">
+                      <object class="GtkBox" id="authentication_and_login_box">
                         <property name="visible">True</property>
-                        <property name="halign">GTK_ALIGN_END</property>
+                        <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
+                        <property name="spacing">10</property>
+                        <property name="margin-top">10</property>
                         <child>
-                          <object class="CcUserImage" id="user_icon_image">
+                          <object class="GtkLabel">
                             <property name="visible">True</property>
-                            <property name="icon_name">avatar-default</property>
-                            <property name="pixel_size">96</property>
-                            <property name="halign">GTK_ALIGN_END</property>
-                            <child internal-child="accessible">
-                              <object class="AtkObject">
-                                <property name="accessible-name" translatable="yes">User Icon</property>
-                              </object>
-                            </child>
+                            <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>
                         <child>
-                          <object class="GtkToggleButton" id="user_icon_button">
+                          <object class="GtkListBox" id="authentication_and_login_listbox">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="relief">GTK_RELIEF_NORMAL</property>
+                            <property name="selection-mode">GTK_SELECTION_NONE</property>
+                            <signal name="row-activated" handler="activate_row"/>
                             <style>
-                              <class name="user-icon-button"/>
+                              <class name="frame"/>
                             </style>
-                            <child internal-child="accessible">
-                              <object class="AtkObject">
-                                <property name="accessible-name" translatable="yes">User Icon</property>
+                            <child>
+                              <object class="GtkBox" id="password_row">
+                                <property name="visible">True</property>
+                                <property name="border-width">10</property>
+                                <property name="spacing">10</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="label" translatable="yes">_Password</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">password_button_label</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkImage">
+                                    <property name="visible">True</property>
+                                    <property name="icon-name">go-next-symbolic</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="password_button_label">
+                                    <property name="visible">True</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
                               </object>
                             </child>
                             <child>
-                              <object class="CcUserImage" id="user_icon_image2">
+                              <object class="GtkBox" id="fingerprint_row">
                                 <property name="visible">True</property>
-                                <property name="icon_name">avatar-default</property>
-                                <property name="pixel_size">96</property>
+                                <property name="border-width">10</property>
+                                <property name="spacing">10</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="label" translatable="yes">_Fingerprint Login</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">fingerprint_button</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkButton" id="fingerprint_button">
+                                    <property name="visible">True</property>
+                                    <signal name="clicked" handler="change_fingerprint" object="CcUserPanel" 
swapped="yes"/>
+                                    <style>
+                                      <class name="flat"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkBox" id="autologin_row">
+                                <property name="visible">True</property>
+                                <property name="border-width">10</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="label" translatable="yes">A_utomatic Login</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">autologin_switch</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkSwitch" id="autologin_switch">
+                                    <property name="visible">True</property>
+                                    <signal name="notify::active" handler="autologin_changed" 
object="CcUserPanel" swapped="yes"/>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
+                              </object>
+                            </child>
+                            <child>
+                              <object class="GtkBox" id="last_login_row">
+                                <property name="visible">True</property>
+                                <property name="border-width">10</property>
+                                <property name="spacing">10</property>
+                                <child>
+                                  <object class="GtkLabel">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">1</property>
+                                    <property name="label" translatable="yes">Last Login</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">last_login_button_label</property>
+                                  </object>
+                                </child>
+                                <child>
+                                  <object class="GtkImage">
+                                    <property name="visible">True</property>
+                                    <property name="icon-name">go-next-symbolic</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="last_login_button_label">
+                                    <property name="visible">True</property>
+                                    <style>
+                                      <class name="dim-label"/>
+                                    </style>
+                                  </object>
+                                  <packing>
+                                    <property name="pack_type">end</property>
+                                  </packing>
+                                </child>
                               </object>
                             </child>
                           </object>
                         </child>
                       </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="language_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">_Language</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">language_button</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">2</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkButton" id="language_button">
-                        <property name="visible">True</property>
-                        <property name="hexpand">True</property>
-                        <signal name="clicked" handler="change_language" object="CcUserPanel" swapped="yes"/>
-                        <style>
-                          <class name="text-button"/>
-                        </style>
-                        <child>
-                          <object class="GtkLabel" id="language_button_label">
-                            <property name="visible">True</property>
-                            <property name="halign">GTK_ALIGN_START</property>
-                          </object>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">2</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="last_login_label">
-                        <property name="visible">True</property>
-                        <property name="xalign">1</property>
-                        <property name="label" translatable="yes">Last Login</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">last_login_button</property>
-                        <style>
-                          <class name="dim-label"/>
-                        </style>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">6</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="last_login_button">
+                      <object class="GtkButton" id="remove_user_button">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <signal name="clicked" handler="show_history" object="CcUserPanel" swapped="yes"/>
+                        <property name="halign">GTK_ALIGN_END</property>
+                        <property name="label" translatable="yes">Remove User…</property>
+                        <property name="margin-top">10</property>
+                        <property name="margin-bottom">10</property>
+                        <signal name="clicked" handler="delete_user" object="CcUserPanel" swapped="yes"/>
                         <style>
-                          <class name="text-button"/>
+                          <class name="destructive-action"/>
                         </style>
-                        <child>
-                          <object class="GtkLabel" id="last_login_button_label">
-                            <property name="visible">True</property>
-                            <property name="halign">GTK_ALIGN_START</property>
-                          </object>
-                        </child>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">6</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
+                        <property name="pack_type">end</property>
                       </packing>
                     </child>
                   </object>
                 </child>
-                <child>
-                  <object class="GtkButton" id="remove_user_button">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="vexpand">True</property>
-                    <property name="halign">GTK_ALIGN_END</property>
-                    <property name="valign">GTK_ALIGN_END</property>
-                    <property name="margin_bottom">20</property>
-                    <property name="margin_top">20</property>
-                    <property name="margin_end">20</property>
-                    <property name="label" translatable="yes">Remove User…</property>
-                    <signal name="clicked" handler="delete_user" object="CcUserPanel" swapped="yes"/>
-                    <style>
-                      <class name="destructive-action"/>
-                    </style>
-                  </object>
-                </child>
               </object>
             </child>
           </object>
@@ -537,30 +542,11 @@
   <object class="GtkSizeGroup">
     <property name="mode">both</property>
     <widgets>
-      <widget name="fingerprint_label"/>
-      <widget name="language_label"/>
-      <widget name="password_label"/>
-      <widget name="account_type_label"/>
-      <widget name="autologin_label"/>
-      <widget name="last_login_label"/>
-    </widgets>
-  </object>
-  <object class="GtkSizeGroup">
-    <property name="mode">both</property>
-    <widgets>
-      <widget name="fingerprint_button"/>
-      <widget name="language_button"/>
-      <widget name="password_button"/>
-      <widget name="account_type_box"/>
-      <widget name="autologin_box"/>
-      <widget name="last_login_button"/>
-    </widgets>
-  </object>
-  <object class="GtkSizeGroup">
-    <property name="mode">both</property>
-    <widgets>
-      <widget name="account_type_standard_button"/>
-      <widget name="account_type_admin_button"/>
+      <widget name="language_row"/>
+      <widget name="password_row"/>
+      <widget name="fingerprint_row"/>
+      <widget name="autologin_row"/>
+      <widget name="last_login_row"/>
     </widgets>
   </object>
 </interface>


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