[gnome-initial-setup] Fix language list size allocation



commit f71d64d4a0f581108e3408bce3524182a70e1728
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 6 11:50:11 2013 +0800

    Fix language list size allocation
    
    When we show the ..., we don't want the list to have a scrollbar or
    expand. When we add all the worlds languages, we add the scrollbar
    and then we need to expand the list, so that it doesn't shrink
    down to a single row.

 .../pages/language/cc-language-chooser.c           |    7 +++++++
 .../pages/language/gis-language-page.ui            |    1 +
 .../pages/language/language-chooser.ui             |    2 +-
 3 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gnome-initial-setup/pages/language/cc-language-chooser.c 
b/gnome-initial-setup/pages/language/cc-language-chooser.c
index 1b2860e..80bcaf6 100644
--- a/gnome-initial-setup/pages/language/cc-language-chooser.c
+++ b/gnome-initial-setup/pages/language/cc-language-chooser.c
@@ -43,6 +43,7 @@ struct _CcLanguageChooserPrivate
         GtkWidget *filter_entry;
         GtkWidget *language_list;
 
+        GtkWidget *scrolled_window;
         GtkWidget *no_results;
         GtkWidget *more_item;
 
@@ -326,6 +327,11 @@ show_more (CcLanguageChooser *chooser)
         gtk_widget_show (priv->filter_entry);
         gtk_widget_grab_focus (priv->filter_entry);
 
+       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
+                                       GTK_POLICY_NEVER,
+                                       GTK_POLICY_AUTOMATIC);
+       gtk_widget_set_valign (GTK_WIDGET (chooser), GTK_ALIGN_FILL);
+
         priv->showing_extra = TRUE;
         gtk_list_box_invalidate_filter (GTK_LIST_BOX (priv->language_list));
         g_object_notify_by_pspec (G_OBJECT (chooser), obj_props[PROP_SHOWING_EXTRA]);
@@ -466,6 +472,7 @@ cc_language_chooser_class_init (CcLanguageChooserClass *klass)
 
         gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), CcLanguageChooser, 
filter_entry);
         gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), CcLanguageChooser, 
language_list);
+        gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), CcLanguageChooser, 
scrolled_window);
 
         object_class->get_property = cc_language_chooser_get_property;
         object_class->set_property = cc_language_chooser_set_property;
diff --git a/gnome-initial-setup/pages/language/gis-language-page.ui 
b/gnome-initial-setup/pages/language/gis-language-page.ui
index 13e2d42..886c5d6 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.ui
+++ b/gnome-initial-setup/pages/language/gis-language-page.ui
@@ -16,6 +16,7 @@
           <object class="CcLanguageChooser" id="language_chooser">
             <property name="visible">True</property>
             <property name="halign">center</property>
+            <property name="valign">start</property>
           </object>
         </child>
       </object>
diff --git a/gnome-initial-setup/pages/language/language-chooser.ui 
b/gnome-initial-setup/pages/language/language-chooser.ui
index f6d80ab..84ae749 100644
--- a/gnome-initial-setup/pages/language/language-chooser.ui
+++ b/gnome-initial-setup/pages/language/language-chooser.ui
@@ -9,7 +9,7 @@
       <object class="GtkScrolledWindow" id="scrolled_window">
         <property name="visible">True</property>
         <property name="hscrollbar-policy">never</property>
-        <property name="vscrollbar-policy">automatic</property>
+        <property name="vscrollbar-policy">never</property>
         <property name="shadow-type">in</property>
         <child>
           <object class="GtkViewport" id="viewport">


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