[gnome-initial-setup/small-screen: 2/3] Hide images when we have no space for them



commit a531639f94b9139e27bbdf54021513d8cfddeff9
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 3 17:13:08 2014 -0500

    Hide images when we have no space for them
    
    Hide the logo / icon we use at the top of each page, when
    we are on a 'small' screen.

 .../pages/account/gis-account-page-enterprise.c    |    5 +++++
 .../pages/account/gis-account-page-enterprise.ui   |    2 +-
 .../pages/account/gis-account-page.c               |    4 ++--
 gnome-initial-setup/pages/goa/gis-goa-page.c       |    5 +++++
 gnome-initial-setup/pages/goa/gis-goa-page.ui      |    2 +-
 .../pages/keyboard/gis-keyboard-page.c             |    5 +++++
 .../pages/keyboard/gis-keyboard-page.ui            |    2 +-
 .../pages/language/gis-language-page.c             |    3 +++
 .../pages/network/gis-network-page.c               |    5 +++++
 .../pages/network/gis-network-page.ui              |    2 +-
 .../pages/password/gis-password-page.c             |    5 +++++
 .../pages/password/gis-password-page.ui            |    2 +-
 gnome-initial-setup/pages/region/gis-region-page.c |    5 +++++
 .../pages/region/gis-region-page.ui                |    2 +-
 .../pages/timezone/gis-timezone-page.c             |    6 ++----
 .../pages/timezone/gis-timezone-page.ui            |    2 +-
 16 files changed, 44 insertions(+), 13 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 865d42e..628c417 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-enterprise.c
+++ b/gnome-initial-setup/pages/account/gis-account-page-enterprise.c
@@ -45,6 +45,7 @@ static void        on_realm_joined     (GObject *source,
 
 struct _GisAccountPageEnterprisePrivate
 {
+  GtkWidget *image;
   GtkWidget *login;
   GtkWidget *password;
   GtkWidget *domain;
@@ -757,6 +758,9 @@ gis_account_page_enterprise_constructed (GObject *object)
                     G_CALLBACK (on_domain_changed), page);
   g_signal_connect (priv->login, "changed",
                     G_CALLBACK (on_entry_changed), page);
+
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->image);
 }
 
 static void
@@ -794,6 +798,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, 
join_dialog);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisAccountPageEnterprise, 
join_name);
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 409de7e..1f4178e 100644
--- a/gnome-initial-setup/pages/account/gis-account-page-enterprise.ui
+++ b/gnome-initial-setup/pages/account/gis-account-page-enterprise.ui
@@ -10,7 +10,7 @@
         <property name="halign">center</property>
         <property name="valign">fill</property>
         <child>
-          <object class="GtkImage" id="image1">
+          <object class="GtkImage" id="image">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="pixel_size">96</property>
diff --git a/gnome-initial-setup/pages/account/gis-account-page.c 
b/gnome-initial-setup/pages/account/gis-account-page.c
index 851ab5c..04a17e5 100644
--- a/gnome-initial-setup/pages/account/gis-account-page.c
+++ b/gnome-initial-setup/pages/account/gis-account-page.c
@@ -105,11 +105,11 @@ set_mode (GisAccountPage *page,
   switch (mode)
     {
     case UM_LOCAL:
-      gtk_stack_set_visible_child (priv->stack, priv->page_local);
+      gtk_stack_set_visible_child (GTK_STACK (priv->stack), priv->page_local);
       gis_account_page_local_shown (priv->page_local);
       break;
     case UM_ENTERPRISE:
-      gtk_stack_set_visible_child (priv->stack, priv->page_enterprise);
+      gtk_stack_set_visible_child (GTK_STACK (priv->stack), priv->page_enterprise);
       gis_account_page_enterprise_shown (priv->page_enterprise);
       break;
     default:
diff --git a/gnome-initial-setup/pages/goa/gis-goa-page.c b/gnome-initial-setup/pages/goa/gis-goa-page.c
index c6dfdc5..41bf05e 100644
--- a/gnome-initial-setup/pages/goa/gis-goa-page.c
+++ b/gnome-initial-setup/pages/goa/gis-goa-page.c
@@ -37,6 +37,7 @@
 
 struct _GisGoaPagePrivate {
   GtkWidget *accounts_list;
+  GtkWidget *image;
 
   GoaClient *goa_client;
   GHashTable *providers;
@@ -288,6 +289,9 @@ gis_goa_page_constructed (GObject *object)
 
   priv->goa_client = goa_client_new_sync (NULL, &error);
 
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->image);
+
   if (priv->goa_client == NULL) {
     g_error ("Failed to get a GoaClient: %s", error->message);
     g_error_free (error);
@@ -344,6 +348,7 @@ gis_goa_page_class_init (GisGoaPageClass *klass)
   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/initial-setup/gis-goa-page.ui");
 
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisGoaPage, accounts_list);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisGoaPage, image);
 
   page_class->page_id = PAGE_ID;
   page_class->locale_changed = gis_goa_page_locale_changed;
diff --git a/gnome-initial-setup/pages/goa/gis-goa-page.ui b/gnome-initial-setup/pages/goa/gis-goa-page.ui
index a788460..2066641 100644
--- a/gnome-initial-setup/pages/goa/gis-goa-page.ui
+++ b/gnome-initial-setup/pages/goa/gis-goa-page.ui
@@ -11,7 +11,7 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkImage" id="image1">
+          <object class="GtkImage" id="image">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="pixel_size">96</property>
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
index 8f3ad34..a011846 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.c
@@ -40,6 +40,7 @@
 
 struct _GisKeyboardPagePrivate {
         GtkWidget *input_chooser;
+        GtkWidget *image;
 
        GDBusProxy *localed;
        GCancellable *cancellable;
@@ -340,6 +341,9 @@ gis_keyboard_page_constructed (GObject *object)
                                  (GAsyncReadyCallback) localed_proxy_ready,
                                  self);
 
+        if (gis_driver_is_small_screen (GIS_PAGE (self)->driver))
+          gtk_widget_hide (priv->image);
+
        /* If we're in new user mode then we're manipulating system settings */
        if (gis_driver_get_mode (GIS_PAGE (self)->driver) == GIS_DRIVER_MODE_NEW_USER)
                priv->permission = polkit_permission_new_sync ("org.freedesktop.locale1.set-keyboard", NULL, 
NULL, NULL);
@@ -364,6 +368,7 @@ gis_keyboard_page_class_init (GisKeyboardPageClass * klass)
         gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/initial-setup/gis-keyboard-page.ui");
 
         gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisKeyboardPage, 
input_chooser);
+        gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisKeyboardPage, image);
 
         page_class->page_id = PAGE_ID;
         page_class->apply = gis_keyboard_page_apply;
diff --git a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui 
b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui
index 063f6de..6ff0ae2 100644
--- a/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui
+++ b/gnome-initial-setup/pages/keyboard/gis-keyboard-page.ui
@@ -9,7 +9,7 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkImage" id="image1">
+          <object class="GtkImage" id="image">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="margin_top">40</property>
diff --git a/gnome-initial-setup/pages/language/gis-language-page.c 
b/gnome-initial-setup/pages/language/gis-language-page.c
index 9bf3250..b1e5f46 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.c
+++ b/gnome-initial-setup/pages/language/gis-language-page.c
@@ -247,6 +247,9 @@ gis_language_page_constructed (GObject *object)
 
   G_OBJECT_CLASS (gis_language_page_parent_class)->constructed (object);
 
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->logo);
+
   update_distro_logo (page);
 
   g_signal_connect (priv->language_chooser, "notify::language",
diff --git a/gnome-initial-setup/pages/network/gis-network-page.c 
b/gnome-initial-setup/pages/network/gis-network-page.c
index a454184..3d1c298 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.c
+++ b/gnome-initial-setup/pages/network/gis-network-page.c
@@ -49,6 +49,7 @@ typedef enum {
 } NMAccessPointSecurity;
 
 struct _GisNetworkPagePrivate {
+  GtkWidget *image;
   GtkWidget *network_list;
   GtkWidget *scrolled_window;
   GtkWidget *no_network_label;
@@ -579,6 +580,9 @@ gis_network_page_constructed (GObject *object)
   gis_page_set_skippable (GIS_PAGE (page), TRUE);
 
  out:
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->image);
+
   gtk_widget_set_visible (GTK_WIDGET (page), visible);
 }
 
@@ -610,6 +614,7 @@ gis_network_page_class_init (GisNetworkPageClass *klass)
 
   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/initial-setup/gis-network-page.ui");
 
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisNetworkPage, image);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisNetworkPage, network_list);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisNetworkPage, scrolled_window);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisNetworkPage, no_network_label);
diff --git a/gnome-initial-setup/pages/network/gis-network-page.ui 
b/gnome-initial-setup/pages/network/gis-network-page.ui
index 7526172..029b875 100644
--- a/gnome-initial-setup/pages/network/gis-network-page.ui
+++ b/gnome-initial-setup/pages/network/gis-network-page.ui
@@ -12,7 +12,7 @@
         <property name="valign">fill</property>
         <property name="margin_bottom">32</property>
         <child>
-          <object class="GtkImage" id="image1">
+          <object class="GtkImage" id="image">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="margin_top">40</property>
diff --git a/gnome-initial-setup/pages/password/gis-password-page.c 
b/gnome-initial-setup/pages/password/gis-password-page.c
index 891de63..08e1e8c 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.c
+++ b/gnome-initial-setup/pages/password/gis-password-page.c
@@ -40,6 +40,7 @@
 
 struct _GisPasswordPagePrivate
 {
+  GtkWidget *image;
   GtkWidget *password_entry;
   GtkWidget *confirm_entry;
   GtkWidget *password_strength;
@@ -242,6 +243,9 @@ gis_password_page_constructed (GObject *object)
 
   validate (page);
 
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->image);
+
   gtk_widget_show (GTK_WIDGET (page));
 }
 
@@ -273,6 +277,7 @@ gis_password_page_class_init (GisPasswordPageClass *klass)
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPasswordPage, 
password_strength);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPasswordPage, 
password_explanation);
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPasswordPage, 
confirm_explanation);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisPasswordPage, image);
 
   page_class->page_id = PAGE_ID;
   page_class->locale_changed = gis_password_page_locale_changed;
diff --git a/gnome-initial-setup/pages/password/gis-password-page.ui 
b/gnome-initial-setup/pages/password/gis-password-page.ui
index d97ee7f..a37ed74 100644
--- a/gnome-initial-setup/pages/password/gis-password-page.ui
+++ b/gnome-initial-setup/pages/password/gis-password-page.ui
@@ -10,7 +10,7 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkImage" id="image1">
+          <object class="GtkImage" id="image">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="pixel_size">96</property>
diff --git a/gnome-initial-setup/pages/region/gis-region-page.c 
b/gnome-initial-setup/pages/region/gis-region-page.c
index b1a5f9b..21dc73e 100644
--- a/gnome-initial-setup/pages/region/gis-region-page.c
+++ b/gnome-initial-setup/pages/region/gis-region-page.c
@@ -39,6 +39,7 @@
 struct _GisRegionPagePrivate
 {
   GtkWidget *region_chooser;
+  GtkWidget *image;
 
   GDBusProxy *localed;
   GPermission *permission;
@@ -192,6 +193,9 @@ gis_region_page_constructed (GObject *object)
   g_signal_connect (priv->region_chooser, "confirm",
                     G_CALLBACK (region_confirmed), page);
 
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->image);
+
   /* If we're in new user mode then we're manipulating system settings */
   if (gis_driver_get_mode (GIS_PAGE (page)->driver) == GIS_DRIVER_MODE_NEW_USER)
     {
@@ -260,6 +264,7 @@ gis_region_page_class_init (GisRegionPageClass *klass)
   gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/initial-setup/gis-region-page.ui");
 
   gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisRegionPage, region_chooser);
+  gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), GisRegionPage, image);
 
   page_class->page_id = PAGE_ID;
   page_class->locale_changed = gis_region_page_locale_changed;
diff --git a/gnome-initial-setup/pages/region/gis-region-page.ui 
b/gnome-initial-setup/pages/region/gis-region-page.ui
index c6049ad..d956820 100644
--- a/gnome-initial-setup/pages/region/gis-region-page.ui
+++ b/gnome-initial-setup/pages/region/gis-region-page.ui
@@ -9,7 +9,7 @@
         <property name="valign">fill</property>
         <property name="orientation">vertical</property>
        <child>
-          <object class="GtkImage" id="image1">
+          <object class="GtkImage" id="image">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="pixel_size">96</property>
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
index f9f2d20..cef9838 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
@@ -441,10 +441,8 @@ gis_timezone_page_constructed (GObject *object)
 
   G_OBJECT_CLASS (gis_timezone_page_parent_class)->constructed (object);
 
-  /* FIXME: the map is too big, so we can't have consistency in page layout
-   * and reasonable window size at the same time; for now, consistency loses.
-   */
-  gtk_widget_hide (priv->image);
+  if (gis_driver_is_small_screen (GIS_PAGE (page)->driver))
+    gtk_widget_hide (priv->image);
 
   error = NULL;
   priv->dtm = timedate1_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.ui 
b/gnome-initial-setup/pages/timezone/gis-timezone-page.ui
index ff7b48e..68a6861 100644
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.ui
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.ui
@@ -28,7 +28,7 @@
             <property name="can_focus">False</property>
             <property name="margin_top">18</property>
             <property name="halign">center</property>
-            <property name="valign">center</property>
+            <property name="valign">start</property>
             <property name="vexpand">True</property>
             <property name="label" translatable="yes">Time Zone</property>
             <attributes>


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