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



commit 2a676f74c82d096f20db9a994d814445e2630ee7
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  | 4 ++++
 gnome-initial-setup/pages/account/gis-account-page-style.css | 4 ++++
 4 files changed, 17 insertions(+)
---
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 69fd317..9af4dd7 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-local.c
+++ b/gnome-initial-setup/pages/account/gis-account-page-local.c
@@ -390,6 +390,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);
 
@@ -438,6 +439,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..520a592 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>
@@ -162,3 +165,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..5a9b727
--- /dev/null
+++ b/gnome-initial-setup/pages/account/gis-account-page-style.css
@@ -0,0 +1,4 @@
+.avatar-button {
+  background: transparent;
+  border: none;
+}


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