[gnome-initial-setup/wip/feborges/generate-user-pics: 2/4] account: Make the user picture button transparent



commit 3903f90cb84f64abe7b6267f47770a327f770fef
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Oct 23 12:03:32 2018 +0200

    account: Make the user picture button transparent
    
    Since the generated pictures are rounded, it looks quite ugly to
    have a squared button in there.
    
    This is compatible with the mockups for the Settings User Panel[0].
    
    [0] https://wiki.gnome.org/Design/OS/AvatarChooser#Tentative_Design
    
    Fixes #6

 gnome-initial-setup/pages/account/account.gresource.xml      | 1 +
 gnome-initial-setup/pages/account/gis-account-page-local.c   | 8 ++++++++
 gnome-initial-setup/pages/account/gis-account-page-local.ui  | 7 ++++---
 gnome-initial-setup/pages/account/gis-account-page-style.css | 5 +++++
 4 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/gnome-initial-setup/pages/account/account.gresource.xml 
b/gnome-initial-setup/pages/account/account.gresource.xml
index d698ba9..9822e02 100644
--- a/gnome-initial-setup/pages/account/account.gresource.xml
+++ b/gnome-initial-setup/pages/account/account.gresource.xml
@@ -5,5 +5,6 @@
     <file preprocess="xml-stripblanks" alias="gis-account-page.ui">gis-account-page.ui</file>
     <file preprocess="xml-stripblanks" alias="gis-account-page-local.ui">gis-account-page-local.ui</file>
     <file preprocess="xml-stripblanks" 
alias="gis-account-page-enterprise.ui">gis-account-page-enterprise.ui</file>
+    <file alias="gis-account-page-style.css">gis-account-page-style.css</file>
   </gresource>
 </gresources>
diff --git a/gnome-initial-setup/pages/account/gis-account-page-local.c 
b/gnome-initial-setup/pages/account/gis-account-page-local.c
index 2c7bd9c..d8273a9 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-local.c
+++ b/gnome-initial-setup/pages/account/gis-account-page-local.c
@@ -386,6 +386,7 @@ gis_account_page_local_constructed (GObject *object)
 {
   GisAccountPageLocal *page = GIS_ACCOUNT_PAGE_LOCAL (object);
   GisAccountPageLocalPrivate *priv = gis_account_page_local_get_instance_private (page);
+  GtkCssProvider *provider;
 
   G_OBJECT_CLASS (gis_account_page_local_parent_class)->constructed (object);
 
@@ -434,6 +435,13 @@ gis_account_page_local_constructed (GObject *object)
                                             page);
 
   validate (page);
+
+  provider = gtk_css_provider_new ();
+  gtk_css_provider_load_from_resource (provider, "/org/gnome/initial-setup/gis-account-page-style.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);
 }
 
 static void
diff --git a/gnome-initial-setup/pages/account/gis-account-page-local.ui 
b/gnome-initial-setup/pages/account/gis-account-page-local.ui
index b09ca48..9c866bb 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-local.ui
+++ b/gnome-initial-setup/pages/account/gis-account-page-local.ui
@@ -13,6 +13,9 @@
             <property name="visible">True</property>
             <property name="margin_top">24</property>
             <property name="halign">center</property>
+            <style>
+              <class name="avatar-button"/>
+            </style>
             <child internal-child="accessible">
               <object class="AtkObject" id="avatar_button_accessible">
                 <property name="accessible-name" translatable="yes">Avatar image</property>
@@ -24,9 +27,6 @@
                 <property name="pixel_size">96</property>
                 <property name="icon_name">avatar-default-symbolic</property>
                 <property name="icon_size">1</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
               </object>
             </child>
           </object>
@@ -162,3 +162,4 @@
     </child>
   </template>
 </interface>
+
diff --git a/gnome-initial-setup/pages/account/gis-account-page-style.css 
b/gnome-initial-setup/pages/account/gis-account-page-style.css
new file mode 100644
index 0000000..1067648
--- /dev/null
+++ b/gnome-initial-setup/pages/account/gis-account-page-style.css
@@ -0,0 +1,5 @@
+.avatar-button {
+  background: transparent;
+  border: none;
+  box-shadow: none;
+}


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