Align treeview in lift list window according to Fremantle Master Layout Guide
authorPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 28 May 2010 18:58:22 +0000 (20:58 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 28 May 2010 20:18:35 +0000 (22:18 +0200)
src/lift-list-window.vala

index 118a81a..59831b5 100644 (file)
@@ -24,6 +24,7 @@ public class LiftListWindow : StackableWindow {
 
        AdacMitfahrclub adac;
        ListStore store;
+       Alignment alignment;
        TreeView tree;
        TreeViewColumn route_column;
        Label no_lifts;
@@ -40,6 +41,11 @@ public class LiftListWindow : StackableWindow {
                gconf = GConf.Client.get_default ();
                store = new ListStore (6, typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (Lift));
 
+               alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
+               alignment.top_padding = MARGIN_HALF;
+               alignment.left_padding = MARGIN_DOUBLE;
+               alignment.right_padding = MARGIN_DOUBLE;
+
                tree = (TreeView) Hildon.gtk_tree_view_new_with_model (UIMode.NORMAL, store);
                Hildon.gtk_widget_set_theme_size (tree, SizeType.FINGER_HEIGHT);
 
@@ -98,9 +104,10 @@ public class LiftListWindow : StackableWindow {
                vbox.pack_start (pannable, true, true, 0);
                vbox.pack_start (no_lifts, false, false, 0);
 
-               add (vbox);
+               alignment.add (vbox);
+               add (alignment);
 
-               vbox.show_all ();
+               alignment.show_all ();
                no_lifts.hide ();
                route_column.set_visible (!BeifahrerProgram.orientation.portrait);
 
@@ -131,6 +138,8 @@ public class LiftListWindow : StackableWindow {
                                                                5, lift);
                        // (LiftFlags.WOMEN_ONLY,ADAC_MEMBER in lift.flags)
                }
+               if (lift_list.length () > 6)
+                       alignment.right_padding = MARGIN_DEFAULT;
                if (lift_list.length () == 0)
                        no_lifts.show ();