[gnome-control-center] user-accounts: Change colors of password strength indicator



commit 4cad3ca408125c15a0ddd952c31a86fbef51822c
Author: Ondrej Holy <oholy redhat com>
Date:   Wed Apr 5 13:31:42 2017 +0200

    user-accounts: Change colors of password strength indicator
    
    Use red-yellow- green colors for strength indicator levels.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780002

 panels/user-accounts/data/user-accounts-dialog.css |   17 +++++++++++++++++
 panels/user-accounts/um-user-panel.c               |    8 ++++++++
 panels/user-accounts/user-accounts.gresource.xml   |    1 +
 3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/panels/user-accounts/data/user-accounts-dialog.css 
b/panels/user-accounts/data/user-accounts-dialog.css
new file mode 100644
index 0000000..54141a7
--- /dev/null
+++ b/panels/user-accounts/data/user-accounts-dialog.css
@@ -0,0 +1,17 @@
+levelbar .strength-weak {
+  background-color: #cc0000;
+  border-color: #cc0000;
+}
+
+levelbar .strength-low {
+  background-color: #f5ce00;
+  border-color: #f5ce00;
+}
+
+levelbar .strength-medium,
+levelbar .strength-good,
+levelbar .strength-high {
+  background-color: #73d216;
+  border-color: #73d216;
+}
+
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 8f2caf1..c1875cb 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -1447,6 +1447,7 @@ cc_user_panel_init (CcUserPanel *self)
         GError *error;
         volatile GType type G_GNUC_UNUSED;
         GtkWidget *button;
+        GtkCssProvider *provider;
 
         d = self->priv = UM_USER_PANEL_PRIVATE (self);
         g_resources_register (um_get_resource ());
@@ -1469,6 +1470,13 @@ cc_user_panel_init (CcUserPanel *self)
                 return;
         }
 
+        provider = gtk_css_provider_new ();
+        gtk_css_provider_load_from_resource (provider, 
"/org/gnome/control-center/user-accounts/user-accounts-dialog.css");
+        gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+                                                   GTK_STYLE_PROVIDER (provider),
+                                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+        g_object_unref (provider);
+
         d->headerbar_buttons = get_widget (d, "headerbar-buttons");
         d->login_screen_settings = settings_or_null ("org.gnome.login-screen");
 
diff --git a/panels/user-accounts/user-accounts.gresource.xml 
b/panels/user-accounts/user-accounts.gresource.xml
index fd960bc..d59e642 100644
--- a/panels/user-accounts/user-accounts.gresource.xml
+++ b/panels/user-accounts/user-accounts.gresource.xml
@@ -7,6 +7,7 @@
     <file alias="password-dialog.ui" preprocess="xml-stripblanks">data/password-dialog.ui</file>
     <file alias="history-dialog.ui" preprocess="xml-stripblanks">data/history-dialog.ui</file>
     <file alias="user-accounts-dialog.ui" preprocess="xml-stripblanks">data/user-accounts-dialog.ui</file>
+    <file alias="user-accounts-dialog.css">data/user-accounts-dialog.css</file>
     <file alias="carousel.ui" preprocess="xml-stripblanks">data/carousel.ui</file>
     <file alias="carousel.css">data/carousel.css</file>
     <file alias="left-index-finger.png">data/icons/left-index-finger.png</file>


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