[master 2/3] Improve language selection at low resolutions.

dashea installerbot-noreply at redhat.com
Tue Nov 3 16:01:42 UTC 2015


From: David Shea <dshea at redhat.com>

Move the two language strings (native and English) into a single column
so that the strings in each row can be positioned independent of other
rows. Allow the English string to be ellipsized so that the really long
ones (e.g., Norwegian Bokmal) don't cut off the right side of the
TreeView and mess up the layout.

Allow the locale selection pane to scroll horizontally in order to
handle long locale names (one of the Chinese locales does not fit at
800x600), and change the column sizing from Grow Only to Automatic to
allow the column to shrink back when switching to other locales. This
way the scrollbar is only shown when needed.
---
 pyanaconda/ui/gui/spokes/langsupport.glade | 19 ++++++-------------
 pyanaconda/ui/gui/spokes/langsupport.py    | 10 +++++-----
 pyanaconda/ui/gui/spokes/welcome.glade     | 21 +++++++--------------
 3 files changed, 18 insertions(+), 32 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/langsupport.glade b/pyanaconda/ui/gui/spokes/langsupport.glade
index 2777769..30d1c8f 100644
--- a/pyanaconda/ui/gui/spokes/langsupport.glade
+++ b/pyanaconda/ui/gui/spokes/langsupport.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.19.0 -->
 <interface>
   <requires lib="gtk+" version="3.2"/>
   <requires lib="AnacondaWidgets" version="1.0"/>
@@ -75,8 +75,8 @@
                     <property name="can_focus">False</property>
                     <property name="margin_left">36</property>
                     <property name="margin_right">36</property>
-                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">Select additional language support to be installed:</property>
+                    <property name="xalign">0</property>
                     <attributes>
                       <attribute name="font-desc" value="Cantarell 14"/>
                       <attribute name="weight" value="normal"/>
@@ -134,8 +134,8 @@
                               </object>
                             </child>
                             <child>
-                              <object class="GtkTreeViewColumn" id="nativeName">
-                                <property name="title" translatable="yes">nativeName</property>
+                              <object class="GtkTreeViewColumn" id="nameColumn">
+                                <property name="title" translatable="yes">name</property>
                                 <property name="expand">True</property>
                                 <property name="clickable">True</property>
                                 <property name="sort_column_id">0</property>
@@ -148,17 +148,10 @@
                                     <attribute name="markup">0</attribute>
                                   </attributes>
                                 </child>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkTreeViewColumn" id="englishName">
-                                <property name="title" translatable="yes">englishName</property>
-                                <property name="expand">True</property>
-                                <property name="clickable">True</property>
-                                <property name="sort_column_id">1</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="englishNameRenderer">
                                     <property name="xalign">0.89999997615814209</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="font">Cantarell Italic 14</property>
                                     <property name="foreground">gray</property>
                                   </object>
@@ -206,7 +199,6 @@
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
-                        <property name="hscrollbar_policy">never</property>
                         <property name="shadow_type">in</property>
                         <child>
                           <object class="GtkTreeView" id="localeView">
@@ -238,6 +230,7 @@
                             </child>
                             <child>
                               <object class="GtkTreeViewColumn" id="localeNativeName">
+                                <property name="sizing">autosize</property>
                                 <property name="title" translatable="yes">nativeName</property>
                                 <property name="expand">True</property>
                                 <property name="clickable">True</property>
diff --git a/pyanaconda/ui/gui/spokes/langsupport.py b/pyanaconda/ui/gui/spokes/langsupport.py
index e8c1740..5ae805d 100644
--- a/pyanaconda/ui/gui/spokes/langsupport.py
+++ b/pyanaconda/ui/gui/spokes/langsupport.py
@@ -86,11 +86,11 @@ def initialize(self):
         override_cell_property(localeNativeColumn, localeNativeNameRenderer,
                 "weight", self._mark_selected_locale_bold)
 
-        for col, rend in [("nativeName", "nativeNameRenderer"),
-                          ("englishName", "englishNameRenderer")]:
-            column = self.builder.get_object(col)
-            renderer = self.builder.get_object(rend)
-            override_cell_property(column, renderer, "weight", self._mark_selected_language_bold)
+        languageNameColumn = self.builder.get_object("nameColumn")
+        nativeNameRenderer = self.builder.get_object("nativeNameRenderer")
+        englishNameRenderer = self.builder.get_object("englishNameRenderer")
+        override_cell_property(languageNameColumn, nativeNameRenderer, "weight", self._mark_selected_language_bold)
+        override_cell_property(languageNameColumn, englishNameRenderer, "weight", self._mark_selected_language_bold)
 
         # If a language has selected locales, highlight every column so that
         # the row appears highlighted
diff --git a/pyanaconda/ui/gui/spokes/welcome.glade b/pyanaconda/ui/gui/spokes/welcome.glade
index bdd5308..02e4434 100644
--- a/pyanaconda/ui/gui/spokes/welcome.glade
+++ b/pyanaconda/ui/gui/spokes/welcome.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.19.0 -->
 <interface>
   <requires lib="gtk+" version="3.2"/>
   <requires lib="AnacondaWidgets" version="1.0"/>
@@ -199,9 +199,9 @@
                     <property name="can_focus">False</property>
                     <property name="margin_left">36</property>
                     <property name="margin_right">36</property>
-                    <property name="xalign">0</property>
                     <property name="ypad">6</property>
                     <property name="label">WELCOME TO %(name)s %(version)s.</property>
+                    <property name="xalign">0</property>
                     <attributes>
                       <attribute name="font-desc" value="Cantarell Bold 16"/>
                     </attributes>
@@ -220,9 +220,9 @@
                     <property name="valign">start</property>
                     <property name="margin_left">36</property>
                     <property name="margin_right">36</property>
-                    <property name="xalign">0</property>
                     <property name="ypad">6</property>
                     <property name="label" translatable="yes">What language would you like to use during the installation process?</property>
+                    <property name="xalign">0</property>
                     <attributes>
                       <attribute name="font-desc" value="Cantarell 12"/>
                     </attributes>
@@ -269,8 +269,8 @@
                               </object>
                             </child>
                             <child>
-                              <object class="GtkTreeViewColumn" id="nativeName">
-                                <property name="title" translatable="yes">nativeName</property>
+                              <object class="GtkTreeViewColumn" id="nameColumn">
+                                <property name="title" translatable="yes">name</property>
                                 <property name="expand">True</property>
                                 <property name="clickable">True</property>
                                 <property name="sort_column_id">0</property>
@@ -283,17 +283,10 @@
                                     <attribute name="markup">0</attribute>
                                   </attributes>
                                 </child>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkTreeViewColumn" id="englishName">
-                                <property name="title" translatable="yes">englishName</property>
-                                <property name="expand">True</property>
-                                <property name="clickable">True</property>
-                                <property name="sort_column_id">1</property>
                                 <child>
                                   <object class="GtkCellRendererText" id="englishNameRenderer">
                                     <property name="xalign">0.89999997615814209</property>
+                                    <property name="ellipsize">end</property>
                                     <property name="font">Cantarell Italic 14</property>
                                     <property name="foreground">gray</property>
                                   </object>
@@ -349,7 +342,6 @@
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
-                        <property name="hscrollbar_policy">never</property>
                         <property name="shadow_type">in</property>
                         <child>
                           <object class="GtkTreeView" id="localeView">
@@ -369,6 +361,7 @@
                             </child>
                             <child>
                               <object class="GtkTreeViewColumn" id="nativeName1">
+                                <property name="sizing">autosize</property>
                                 <property name="title" translatable="yes">nativeName</property>
                                 <property name="expand">True</property>
                                 <property name="clickable">True</property>


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/18267cf8a4ea676e06b0e10d33277be1ecdbc87b


More information about the anaconda-patches mailing list