[gnome-initial-setup] summary: fix layout on low resolution screens



commit 8a5358cfcfbb8a6d284bfb3a25d4c82ee39d8193
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Mar 15 22:08:42 2016 -0300

    summary: fix layout on low resolution screens
    
    When in 720x480 screen with Large Text setting enabled,
    the text "You're ready to go!" text is placed on top of
    the custom check image. That happens because we're not
    really adding an image, but setting the background of a
    GtkFrame.
    
    Fix that by adding the custom check as a centered GtkImage,
    and remove all the hacks and custom CSS used to make the
    old page work.

 .../pages/summary/gis-summary-page.c               |   26 -----------
 .../pages/summary/gis-summary-page.css             |    3 -
 .../pages/summary/gis-summary-page.ui              |   48 ++++++++++++-------
 .../pages/summary/summary.gresource.xml            |    1 -
 4 files changed, 30 insertions(+), 48 deletions(-)
---
diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.c 
b/gnome-initial-setup/pages/summary/gis-summary-page.c
index 62cdcdf..db54924 100644
--- a/gnome-initial-setup/pages/summary/gis-summary-page.c
+++ b/gnome-initial-setup/pages/summary/gis-summary-page.c
@@ -360,30 +360,6 @@ gis_summary_page_locale_changed (GisPage *page)
 }
 
 static void
-add_style_from_resource (const char *resource)
-{
-  GtkCssProvider *provider;
-  GFile *file;
-  char *uri;
-
-  provider = gtk_css_provider_new ();
-
-  uri = g_strconcat ("resource://", resource, NULL);
-  file = g_file_new_for_uri (uri);
-
-  if (!gtk_css_provider_load_from_file (provider, file, NULL))
-    goto out;
-
-  gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
-                                             GTK_STYLE_PROVIDER (provider),
-                                             GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- out:
-  g_object_unref (file);
-  g_free (uri);
-}
-
-static void
 gis_summary_page_class_init (GisSummaryPageClass *klass)
 {
   GisPageClass *page_class = GIS_PAGE_CLASS (klass);
@@ -399,8 +375,6 @@ gis_summary_page_class_init (GisSummaryPageClass *klass)
   page_class->locale_changed = gis_summary_page_locale_changed;
   page_class->shown = gis_summary_page_shown;
   object_class->constructed = gis_summary_page_constructed;
-
-  add_style_from_resource ("/org/gnome/initial-setup/gis-summary-page.css");
 }
 
 static void
diff --git a/gnome-initial-setup/pages/summary/gis-summary-page.ui 
b/gnome-initial-setup/pages/summary/gis-summary-page.ui
index 749e970..8b7c311 100644
--- a/gnome-initial-setup/pages/summary/gis-summary-page.ui
+++ b/gnome-initial-setup/pages/summary/gis-summary-page.ui
@@ -12,31 +12,18 @@
         <property name="hexpand">True</property>
         <property name="vexpand">True</property>
         <property name="shadow-type">none</property>
-        <style>
-          <class name="gis-summary-page" />
-        </style>
         <child>
           <object class="GtkBox" id="box">
             <property name="visible">True</property>
             <property name="halign">center</property>
             <property name="valign">center</property>
-            <property name="spacing">20</property>
-            <property name="margin-top">75</property>
             <property name="orientation">vertical</property>
-            <child>
-              <object class="GtkLabel" id="title">
+            <child type="center">
+              <object class="GtkImage" id="image">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">You're ready to go!</property>
-                <attributes>
-                  <attribute name="weight" value="bold"/>
-                  <attribute name="scale" value="1.8"/>
-                </attributes>
-              </object>
-            </child>
-            <child>
-              <object class="GtkLabel" id="tagline">
-                <property name="visible">True</property>
-                <property name="justify">center</property>
+                <property name="resource">/org/gnome/initial-setup/ready-to-go.svg</property>
+                <property name="width_request">96</property>
+                <property name="height_request">96</property>
               </object>
             </child>
             <child>
@@ -58,6 +45,31 @@
                   </object>
                 </child>
               </object>
+              <packing>
+                <property name="pack_type">end</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="tagline">
+                <property name="visible">True</property>
+                <property name="justify">center</property>
+              </object>
+              <packing>
+                <property name="pack_type">end</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="title">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">You're ready to go!</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                  <attribute name="scale" value="1.8"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="pack_type">end</property>
+              </packing>
             </child>
           </object>
         </child>
diff --git a/gnome-initial-setup/pages/summary/summary.gresource.xml 
b/gnome-initial-setup/pages/summary/summary.gresource.xml
index ccf93ac..75ed09e 100644
--- a/gnome-initial-setup/pages/summary/summary.gresource.xml
+++ b/gnome-initial-setup/pages/summary/summary.gresource.xml
@@ -2,7 +2,6 @@
 <gresources>
   <gresource prefix="/org/gnome/initial-setup">
     <file preprocess="xml-stripblanks" alias="gis-summary-page.ui">gis-summary-page.ui</file>
-    <file alias="gis-summary-page.css">gis-summary-page.css</file>
     <file alias="ready-to-go.svg">ready-to-go.svg</file>
   </gresource>
 </gresources>


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