[gnome-initial-setup] password: Change colors of password strength indicator
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] password: Change colors of password strength indicator
- Date: Wed, 31 May 2017 09:07:41 +0000 (UTC)
commit 8d731894ee1c1d6523698805713d569eb7fc73cb
Author: Ondrej Holy <oholy redhat com>
Date: Tue May 30 11:12:23 2017 +0200
password: Change colors of password strength indicator
Use red-yellow- green colors for strength indicator levels.
https://bugzilla.gnome.org/show_bug.cgi?id=783236
.../pages/password/gis-password-page.c | 9 +++++++++
.../pages/password/gis-password-page.css | 16 ++++++++++++++++
.../pages/password/password.gresource.xml | 1 +
3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gnome-initial-setup/pages/password/gis-password-page.c
b/gnome-initial-setup/pages/password/gis-password-page.c
index 13c2eff..cefa30e 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.c
+++ b/gnome-initial-setup/pages/password/gis-password-page.c
@@ -290,8 +290,17 @@ gis_password_page_class_init (GisPasswordPageClass *klass)
static void
gis_password_page_init (GisPasswordPage *page)
{
+ GtkCssProvider *provider;
+
g_resources_register (password_get_resource ());
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_resource (provider, "/org/gnome/initial-setup/gis-password-page.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);
+
gtk_widget_init_template (GTK_WIDGET (page));
}
diff --git a/gnome-initial-setup/pages/password/gis-password-page.css
b/gnome-initial-setup/pages/password/gis-password-page.css
new file mode 100644
index 0000000..e9b5f54
--- /dev/null
+++ b/gnome-initial-setup/pages/password/gis-password-page.css
@@ -0,0 +1,16 @@
+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/gnome-initial-setup/pages/password/password.gresource.xml
b/gnome-initial-setup/pages/password/password.gresource.xml
index 404e623..22cad98 100644
--- a/gnome-initial-setup/pages/password/password.gresource.xml
+++ b/gnome-initial-setup/pages/password/password.gresource.xml
@@ -2,5 +2,6 @@
<gresources>
<gresource prefix="/org/gnome/initial-setup">
<file preprocess="xml-stripblanks" alias="gis-password-page.ui">gis-password-page.ui</file>
+ <file alias="gis-password-page.css">gis-password-page.css</file>
</gresource>
</gresources>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]