[gnome-initial-setup: 2/3] Use page headers



commit 74e798f62d1b81e665ed0ba0fe30210e0904d821
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Jul 24 16:50:38 2019 +0200

    Use page headers
    
    This will siplify pages and help making them look homogeneous.

 .../pages/account/gis-account-page-enterprise.c    |  9 ++--
 .../pages/account/gis-account-page-enterprise.ui   | 41 +++-------------
 .../pages/account/gis-account-page-local.c         | 11 +++--
 .../pages/account/gis-account-page-local.ui        | 23 ++-------
 gnome-initial-setup/pages/goa/gis-goa-page.c       |  3 ++
 gnome-initial-setup/pages/goa/gis-goa-page.ui      | 57 ++--------------------
 .../pages/keyboard/gis-keyboard-page.c             |  3 ++
 .../pages/keyboard/gis-keyboard-page.ui            | 37 ++------------
 .../pages/network/gis-network-page.c               |  3 ++
 .../pages/network/gis-network-page.ui              | 37 ++------------
 .../pages/password/gis-password-page.c             |  3 ++
 .../pages/password/gis-password-page.ui            | 43 +++-------------
 .../pages/privacy/gis-privacy-page.c               |  3 ++
 .../pages/privacy/gis-privacy-page.ui              | 28 ++---------
 gnome-initial-setup/pages/region/gis-region-page.c |  3 ++
 .../pages/region/gis-region-page.ui                | 41 +++-------------
 .../pages/software/gis-software-page.c             |  9 ++--
 .../pages/software/gis-software-page.ui            | 33 ++-----------
 .../pages/timezone/gis-timezone-page.c             |  3 ++
 .../pages/timezone/gis-timezone-page.ui            | 36 ++------------
 20 files changed, 89 insertions(+), 337 deletions(-)
---
diff --git a/gnome-initial-setup/pages/account/gis-account-page-enterprise.c 
b/gnome-initial-setup/pages/account/gis-account-page-enterprise.c
index 2ec201d..70a8179 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-enterprise.c
+++ b/gnome-initial-setup/pages/account/gis-account-page-enterprise.c
@@ -32,6 +32,8 @@
 #include "um-realm-manager.h"
 #include "um-utils.h"
 
+#include "gis-page-header.h"
+
 static void        join_show_prompt    (GisAccountPageEnterprise *page,
                                         GError *error);
 
@@ -45,7 +47,7 @@ static void        on_realm_joined     (GObject *source,
 
 struct _GisAccountPageEnterprisePrivate
 {
-  GtkWidget *image;
+  GtkWidget *header;
   GtkWidget *login;
   GtkWidget *password;
   GtkWidget *domain;
@@ -748,7 +750,7 @@ gis_account_page_enterprise_realize (GtkWidget *widget)
 
   gis_page = gtk_widget_get_ancestor (widget, GIS_TYPE_PAGE);
   g_object_bind_property (gis_page, "small-screen",
-                          priv->image, "visible",
+                          priv->header, "show-icon",
                           G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
 
   GTK_WIDGET_CLASS (gis_account_page_enterprise_parent_class)->realize (widget);
@@ -815,7 +817,7 @@ gis_account_page_enterprise_class_init (GisAccountPageEnterpriseClass *klass)
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, domain);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, 
domain_entry);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, 
realms_model);
-  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, image);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, header);
 
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, 
join_dialog);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, 
join_name);
@@ -834,6 +836,7 @@ gis_account_page_enterprise_class_init (GisAccountPageEnterpriseClass *klass)
 static void
 gis_account_page_enterprise_init (GisAccountPageEnterprise *page)
 {
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
   gtk_widget_init_template (GTK_WIDGET (page));
 }
 
diff --git a/gnome-initial-setup/pages/account/gis-account-page-enterprise.ui 
b/gnome-initial-setup/pages/account/gis-account-page-enterprise.ui
index c25c42a..5432e55 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-enterprise.ui
+++ b/gnome-initial-setup/pages/account/gis-account-page-enterprise.ui
@@ -10,45 +10,16 @@
         <property name="halign">center</property>
         <property name="valign">fill</property>
         <child>
-          <object class="GtkImage" id="image">
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="pixel_size">96</property>
-            <property name="icon_name">dialog-password-symbolic</property>
-            <property name="icon_size">1</property>
-            <property name="margin_top">24</property>
-            <property name="margin_bottom">26</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="hexpand">True</property>
-            <property name="label" translatable="yes">Enterprise Login</property>
-            <property name="margin_bottom">14</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="subtitle">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="valign">start</property>
             <property name="margin_bottom">26</property>
-            <property name="label" translatable="yes">Enterprise login allows an existing centrally managed 
user account to be used on this device. You can also use this account to access company resources on the 
internet.</property>
-            <property name="justify">center</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">45</property>
+            <property name="margin_top">24</property>
+            <property name="title" translatable="yes">Enterprise Login</property>
+            <property name="subtitle" translatable="yes">Enterprise login allows an existing centrally 
managed user account to be used on this device. You can also use this account to access company resources on 
the internet.</property>
+            <property name="icon_name">dialog-password-symbolic</property>
+            <property name="show_icon">True</property>
           </object>
         </child>
-
         <child>
           <object class="GtkGrid" id="form">
             <property name="visible">True</property>
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 ded94d0..2bb6960 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-local.c
+++ b/gnome-initial-setup/pages/account/gis-account-page-local.c
@@ -33,6 +33,8 @@
 #include "um-utils.h"
 #include "um-photo-dialog.h"
 
+#include "gis-page-header.h"
+
 #define GOA_API_IS_SUBJECT_TO_CHANGE
 #include <goa/goa.h>
 
@@ -45,7 +47,7 @@ struct _GisAccountPageLocalPrivate
 {
   GtkWidget *avatar_button;
   GtkWidget *avatar_image;
-  GtkWidget *subtitle;
+  GtkWidget *header;
   GtkWidget *fullname_entry;
   GtkWidget *username_combo;
   gboolean   has_custom_username;
@@ -200,7 +202,7 @@ prepopulate_account_page (GisAccountPageLocal *page)
   }
 
   if (name) {
-    gtk_label_set_text (GTK_LABEL (priv->subtitle), _("Please check the name and username. You can choose a 
picture too."));
+    g_object_set (priv->header, "subtitle", _("Please check the name and username. You can choose a picture 
too."), NULL);
     gtk_entry_set_text (GTK_ENTRY (priv->fullname_entry), name);
   }
 
@@ -419,7 +421,7 @@ gis_account_page_local_constructed (GObject *object)
   /* FIXME: change this for a large deployment scenario; maybe through a GSetting? */
   priv->account_type = ACT_USER_ACCOUNT_TYPE_ADMINISTRATOR;
 
-  gtk_label_set_text (GTK_LABEL (priv->subtitle), _("We need a few details to complete setup."));
+  g_object_set (priv->header, "subtitle", _("We need a few details to complete setup."), NULL);
   gtk_entry_set_text (GTK_ENTRY (priv->fullname_entry), "");
   gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->username_combo))));
   priv->has_custom_username = FALSE;
@@ -541,7 +543,7 @@ gis_account_page_local_class_init (GisAccountPageLocalClass *klass)
 
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, 
avatar_button);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, avatar_image);
-  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, subtitle);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, header);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, 
fullname_entry);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, 
username_combo);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageLocal, 
username_explanation);
@@ -565,6 +567,7 @@ gis_account_page_local_class_init (GisAccountPageLocalClass *klass)
 static void
 gis_account_page_local_init (GisAccountPageLocal *page)
 {
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
   gtk_widget_init_template (GTK_WIDGET (page));
 }
 
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 9c866bb..520f80a 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-local.ui
+++ b/gnome-initial-setup/pages/account/gis-account-page-local.ui
@@ -32,28 +32,11 @@
           </object>
         </child>
         <child>
-          <object class="GtkLabel" id="title">
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
             <property name="margin_top">18</property>
-            <property name="hexpand">True</property>
-            <property name="label" translatable="yes">About You</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="subtitle">
-            <property name="visible">True</property>
-            <property name="valign">start</property>
-            <property name="margin_top">6</property>
-            <property name="label" translatable="yes">Please provide a name and username. You can choose a 
picture too.</property>
-            <property name="justify">center</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">50</property>
+            <property name="title" translatable="yes">About You</property>
+            <property name="subtitle" translatable="yes">Please provide a name and username. You can choose 
a picture too.</property>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/goa/gis-goa-page.c b/gnome-initial-setup/pages/goa/gis-goa-page.c
index 3ed4e98..deb663c 100644
--- a/gnome-initial-setup/pages/goa/gis-goa-page.c
+++ b/gnome-initial-setup/pages/goa/gis-goa-page.c
@@ -35,6 +35,8 @@
 #include <glib/gi18n.h>
 #include <gio/gio.h>
 
+#include "gis-page-header.h"
+
 struct _GisGoaPagePrivate {
   GtkWidget *accounts_list;
 
@@ -359,6 +361,7 @@ static void
 gis_goa_page_init (GisGoaPage *page)
 {
   g_resources_register (goa_get_resource ());
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
 
   gtk_widget_init_template (GTK_WIDGET (page));
 }
diff --git a/gnome-initial-setup/pages/goa/gis-goa-page.ui b/gnome-initial-setup/pages/goa/gis-goa-page.ui
index 8971b62..9ef1d95 100644
--- a/gnome-initial-setup/pages/goa/gis-goa-page.ui
+++ b/gnome-initial-setup/pages/goa/gis-goa-page.ui
@@ -11,61 +11,14 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkImage" id="image1">
-            <property name="visible" bind-source="GisGoaPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="pixel_size">96</property>
-            <property name="icon_name">goa-panel-symbolic</property>
-            <property name="icon_size">1</property>
             <property name="margin_top">24</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="margin_top">18</property>
-            <property name="label" translatable="yes">Connect Your Online Accounts</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.6000000000000001"/>
-            </attributes>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="margin_top">6</property>
-            <property name="label" translatable="yes">Connect your accounts to easily access your email, 
online calendar, contacts, documents and photos.</property>
-            <property name="justify">left</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">50</property>
-            <property name="xalign">0</property>
+            <property name="title" translatable="yes">Connect Your Online Accounts</property>
+            <property name="subtitle" translatable="yes">Connect your accounts to easily access your email, 
online calendar, contacts, documents and photos.</property>
+            <property name="icon_name">goa-panel-symbolic</property>
+            <property name="show_icon" bind-source="GisGoaPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
         </child>
         <child>
           <object class="GtkFrame" id="frame">
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
index 237c528..a49e7b5 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
@@ -39,6 +39,8 @@
 
 #include "cc-common-language.h"
 
+#include "gis-page-header.h"
+
 #define GNOME_DESKTOP_INPUT_SOURCES_DIR "org.gnome.desktop.input-sources"
 #define KEY_CURRENT_INPUT_SOURCE "current"
 #define KEY_INPUT_SOURCES        "sources"
@@ -502,6 +504,7 @@ static void
 gis_keyboard_page_init (GisKeyboardPage *self)
 {
         g_resources_register (keyboard_get_resource ());
+        g_type_ensure (GIS_TYPE_PAGE_HEADER);
        g_type_ensure (CC_TYPE_INPUT_CHOOSER);
 
         gtk_widget_init_template (GTK_WIDGET (self));
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui
index 5b6cf9e..8d022fb 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui
@@ -9,40 +9,13 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkImage" id="image1">
-            <property name="visible" bind-source="GisKeyboardPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
-            <property name="can_focus">False</property>
+          <object class="GisPageHeader" id="header">
+            <property name="visible">True</property>
             <property name="margin_top">24</property>
-            <property name="pixel_size">96</property>
+            <property name="title" translatable="yes">Typing</property>
+            <property name="subtitle" translatable="yes">Select your keyboard layout or an input 
method.</property>
             <property name="icon_name">input-keyboard-symbolic</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">18</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="label" translatable="yes">Typing</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="subtitle">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">6</property>
-            <property name="label" translatable="yes">Select your keyboard layout or an input 
method.</property>
-            <property name="justify">left</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">50</property>
+            <property name="show_icon" bind-source="GisKeyboardPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/network/gis-network-page.c 
b/gnome-initial-setup/pages/network/gis-network-page.c
index dff36bf..387420d 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.c
+++ b/gnome-initial-setup/pages/network/gis-network-page.c
@@ -32,6 +32,8 @@
 
 #include "network-dialogs.h"
 
+#include "gis-page-header.h"
+
 typedef enum {
   NM_AP_SEC_UNKNOWN,
   NM_AP_SEC_NONE,
@@ -738,6 +740,7 @@ static void
 gis_network_page_init (GisNetworkPage *page)
 {
   g_resources_register (network_get_resource ());
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
 
   gtk_widget_init_template (GTK_WIDGET (page));
 }
diff --git a/gnome-initial-setup/pages/network/gis-network-page.ui 
b/gnome-initial-setup/pages/network/gis-network-page.ui
index 8ab17f6..a8ab325 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.ui
+++ b/gnome-initial-setup/pages/network/gis-network-page.ui
@@ -12,40 +12,13 @@
         <property name="valign">fill</property>
         <property name="margin_bottom">32</property>
         <child>
-          <object class="GtkImage" id="image1">
-            <property name="visible" bind-source="GisNetworkPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
-            <property name="can_focus">False</property>
+          <object class="GisPageHeader" id="header">
+            <property name="visible">True</property>
             <property name="margin_top">24</property>
-            <property name="pixel_size">96</property>
+            <property name="title" translatable="yes">Wi-Fi</property>
+            <property name="subtitle" translatable="yes">Connecting to the Internet will enable you to set 
the time, add your details, and enable you to access your email, calendar, and contacts. It is also necessary 
for enterprise login accounts.</property>
             <property name="icon_name">network-wireless-symbolic</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">18</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="label" translatable="yes">Wi-Fi</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="label1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">6</property>
-            <property name="label" translatable="yes">Connecting to the Internet will enable you to set the 
time, add your details, and enable you to access your email, calendar, and contacts. It is also necessary for 
enterprise login accounts.</property>
-            <property name="justify">left</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">50</property>
+            <property name="show_icon" bind-source="GisNetworkPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/password/gis-password-page.c 
b/gnome-initial-setup/pages/password/gis-password-page.c
index e3daae7..4b32a3f 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.c
+++ b/gnome-initial-setup/pages/password/gis-password-page.c
@@ -35,6 +35,8 @@
 #include <glib/gi18n.h>
 #include <gio/gio.h>
 
+#include "gis-page-header.h"
+
 #define VALIDATION_TIMEOUT 600
 
 struct _GisPasswordPagePrivate
@@ -299,6 +301,7 @@ gis_password_page_init (GisPasswordPage *page)
   GtkCssProvider *provider;
 
   g_resources_register (password_get_resource ());
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
 
   provider = gtk_css_provider_new ();
   gtk_css_provider_load_from_resource (provider, "/org/gnome/initial-setup/gis-password-page.css");
diff --git a/gnome-initial-setup/pages/password/gis-password-page.ui 
b/gnome-initial-setup/pages/password/gis-password-page.ui
index 0c94bcf..500d0d3 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.ui
+++ b/gnome-initial-setup/pages/password/gis-password-page.ui
@@ -10,44 +10,13 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkImage" id="image1">
-            <property name="visible" bind-source="GisPasswordPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
-            <property name="can_focus">False</property>
-            <property name="pixel_size">96</property>
-            <property name="icon_name">dialog-password-symbolic</property>
-            <property name="icon_size">1</property>
-            <property name="margin_top">24</property>
-            <property name="margin_bottom">18</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="margin_top">18</property>
-            <property name="hexpand">True</property>
-            <property name="label" translatable="yes">Set a Password</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="subtitle">
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="valign">start</property>
-            <property name="margin_top">14</property>
-            <property name="label" translatable="yes">Be careful not to lose your password.</property>
-            <property name="justify">center</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">50</property>
+            <property name="margin_top">24</property>
+            <property name="title" translatable="yes">Set a Password</property>
+            <property name="subtitle" translatable="yes">Be careful not to lose your password.</property>
+            <property name="icon_name">dialog-password-symbolic</property>
+            <property name="show_icon" bind-source="GisPasswordPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.c 
b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
index 7d83d62..dc2b03f 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
@@ -32,6 +32,8 @@
 #include <locale.h>
 #include <gtk/gtk.h>
 
+#include "gis-page-header.h"
+
 struct _GisPrivacyPagePrivate
 {
   GtkWidget *location_switch;
@@ -318,6 +320,7 @@ static void
 gis_privacy_page_init (GisPrivacyPage *page)
 {
   g_resources_register (privacy_get_resource ());
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
   gtk_widget_init_template (GTK_WIDGET (page));
 }
 
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui 
b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
index 7bc11e8..1afde98 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
@@ -9,31 +9,13 @@
         <property name="halign">center</property>
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
-       <child>
-          <object class="GtkImage" id="image1">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="pixel_size">96</property>
-            <property name="icon_name">preferences-system-privacy-symbolic</property>
-            <property name="icon_size">1</property>
-            <property name="margin_top">24</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
         <child>
-          <object class="GtkLabel" id="title">
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="margin_top">18</property>
-            <property name="label" translatable="yes">Privacy</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
+            <property name="margin_top">24</property>
+            <property name="title" translatable="yes">Privacy</property>
+            <property name="icon_name">preferences-system-privacy-symbolic</property>
+            <property name="show_icon" bind-source="GisPrivacyPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/region/gis-region-page.c 
b/gnome-initial-setup/pages/region/gis-region-page.c
index 5cb597e..218db1b 100644
--- a/gnome-initial-setup/pages/region/gis-region-page.c
+++ b/gnome-initial-setup/pages/region/gis-region-page.c
@@ -36,6 +36,8 @@
 #include <locale.h>
 #include <gtk/gtk.h>
 
+#include "gis-page-header.h"
+
 struct _GisRegionPagePrivate
 {
   GtkWidget *region_chooser;
@@ -267,6 +269,7 @@ static void
 gis_region_page_init (GisRegionPage *page)
 {
   g_resources_register (region_get_resource ());
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
   g_type_ensure (CC_TYPE_REGION_CHOOSER);
 
   gtk_widget_init_template (GTK_WIDGET (page));
diff --git a/gnome-initial-setup/pages/region/gis-region-page.ui 
b/gnome-initial-setup/pages/region/gis-region-page.ui
index 16394bd..abcab7d 100644
--- a/gnome-initial-setup/pages/region/gis-region-page.ui
+++ b/gnome-initial-setup/pages/region/gis-region-page.ui
@@ -8,43 +8,14 @@
         <property name="halign">center</property>
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
-       <child>
-          <object class="GtkImage" id="image1">
-            <property name="visible" bind-source="GisRegionPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
-            <property name="can_focus">False</property>
-            <property name="pixel_size">96</property>
-            <property name="icon_name">preferences-desktop-locale-symbolic</property>
-            <property name="icon_size">1</property>
-            <property name="margin_top">40</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="margin_top">18</property>
-            <property name="label" translatable="yes">Region</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
         <child>
-          <object class="GtkLabel" id="label">
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="valign">start</property>
-            <property name="margin_top">6</property>
-            <property name="label" translatable="yes">Choose your country or region.</property>
-            <property name="justify">center</property>
-            <property name="wrap">True</property>
-            <property name="max-width-chars">50</property>
+            <property name="margin_top">40</property>
+            <property name="title" translatable="yes">Region</property>
+            <property name="subtitle" translatable="yes">Choose your country or region.</property>
+            <property name="icon_name">preferences-desktop-locale-symbolic</property>
+            <property name="show_icon" bind-source="GisRegionPage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/software/gis-software-page.c 
b/gnome-initial-setup/pages/software/gis-software-page.c
index 0f63fd6..62fc90d 100644
--- a/gnome-initial-setup/pages/software/gis-software-page.c
+++ b/gnome-initial-setup/pages/software/gis-software-page.c
@@ -36,11 +36,13 @@
 #include <packagekit-glib2/packagekit.h>
 #endif
 
+#include "gis-page-header.h"
+
 struct _GisSoftwarePagePrivate
 {
   GtkWidget *more_popover;
   GtkWidget *proprietary_switch;
-  GtkWidget *text_label;
+  GtkWidget *header;
 
   GSettings *software_settings;
   guint enable_count;
@@ -190,7 +192,7 @@ gis_software_page_locale_changed (GisPage *gis_page)
   g_string_append (str,
                    /* TRANSLATORS: this is the third party repositories info bar. */
                    _("Some of this software is proprietary and therefore has restrictions on use, sharing, 
and access to source code."));
-  gtk_label_set_label (GTK_LABEL (priv->text_label), str->str);
+  g_object_set (priv->header, "subtitle", str->str, NULL);
 }
 
 static gboolean
@@ -225,7 +227,7 @@ gis_software_page_class_init (GisSoftwarePageClass *klass)
   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/initial-setup/gis-software-page.ui");
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisSoftwarePage, more_popover);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisSoftwarePage, 
proprietary_switch);
-  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisSoftwarePage, text_label);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisSoftwarePage, header);
   gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), activate_link);
   gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (klass), state_set);
 
@@ -240,6 +242,7 @@ static void
 gis_software_page_init (GisSoftwarePage *page)
 {
   g_resources_register (software_get_resource ());
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
 
   gtk_widget_init_template (GTK_WIDGET (page));
 }
diff --git a/gnome-initial-setup/pages/software/gis-software-page.ui 
b/gnome-initial-setup/pages/software/gis-software-page.ui
index d510e65..0e669b3 100644
--- a/gnome-initial-setup/pages/software/gis-software-page.ui
+++ b/gnome-initial-setup/pages/software/gis-software-page.ui
@@ -10,39 +10,12 @@
         <property name="halign">center</property>
         <property name="valign">fill</property>
         <child>
-          <object class="GtkImage" id="image">
+          <object class="GisPageHeader" id="header">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
             <property name="margin_top">24</property>
-            <property name="pixel_size">96</property>
+            <property name="title" translatable="yes">Additional Software Repositories</property>
             <property name="icon_name">folder-download-symbolic</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="margin_bottom">18</property>
-            <property name="label" translatable="yes">Additional Software Repositories</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="text_label">
-            <property name="visible">True</property>
-            <property name="margin-top">40</property>
-            <property name="xalign">0.5</property>
-            <property name="justify">center</property>
-            <property name="max-width-chars">65</property>
-            <property name="wrap">True</property>
+            <property name="show_icon" bind-source="GisSoftwarePage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
index e1b8aaf..729e514 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -49,6 +49,8 @@
 #include "cc-timezone-map.h"
 #include "gis-bubble-widget.h"
 
+#include "gis-page-header.h"
+
 #define DEFAULT_TZ "Europe/London"
 #define DESKTOP_ID "gnome-datetime-panel"
 
@@ -461,6 +463,7 @@ gis_timezone_page_init (GisTimezonePage *page)
   g_resources_register (datetime_get_resource ());
   g_type_ensure (CC_TYPE_TIMEZONE_MAP);
   g_type_ensure (GIS_TYPE_BUBBLE_WIDGET);
+  g_type_ensure (GIS_TYPE_PAGE_HEADER);
 
   gtk_widget_init_template (GTK_WIDGET (page));
 }
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.ui 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.ui
index 84b10d7..d648c7d 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.ui
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.ui
@@ -11,30 +11,13 @@
         <property name="halign">center</property>
         <property name="valign">fill</property>
         <child>
-          <object class="GtkImage" id="image">
-            <property name="visible" bind-source="GisTimezonePage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
-            <property name="can_focus">False</property>
+          <object class="GisPageHeader" id="header">
+            <property name="visible">True</property>
             <property name="margin_top">24</property>
-            <property name="pixel_size">96</property>
+            <property name="title" translatable="yes">Time Zone</property>
+            <property name="subtitle" translatable="yes">The time zone will be set automatically if your 
location can be found. You can also search for a city to set it yourself.</property>
             <property name="icon_name">find-location-symbolic</property>
-            <style>
-              <class name="dim-label" />
-            </style>
-          </object>
-        </child>
-        <child>
-          <object class="GtkLabel" id="title">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="margin_top">18</property>
-            <property name="halign">center</property>
-            <property name="valign">start</property>
-            <property name="vexpand">True</property>
-            <property name="label" translatable="yes">Time Zone</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-              <attribute name="scale" value="1.8"/>
-            </attributes>
+            <property name="show_icon" bind-source="GisTimezonePage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
           </object>
         </child>
         <child>
@@ -44,15 +27,6 @@
             <property name="valign">center</property>
             <property name="orientation">vertical</property>
             <property name="spacing">14</property>
-            <child>
-              <object class="GtkLabel">
-                <property name="visible">True</property>
-                <property name="xalign">0</property>
-                <property name="halign">center</property>
-                <property name="wrap">True</property>
-                <property name="label" translatable="yes">The time zone will be set automatically if your 
location can be found. You can also search for a city to set it yourself.</property>
-              </object>
-            </child>
             <child>
               <object class="GWeatherLocationEntry" id="search_entry">
                 <property name="visible">True</property>



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