Settings dialog: two columns of plugin settings buttons
authorPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 9 Nov 2009 20:59:30 +0000 (21:59 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 11 Nov 2009 18:08:27 +0000 (19:08 +0100)
src/settings-dialog.vala

index d84d947..26aebf3 100644 (file)
@@ -45,6 +45,8 @@ class SettingsDialog : Gtk.Dialog {
                        vbox = (VBox) get_content_area ();
                }
 
+               HBox hbox;
+               int i = 0;
                buttons = new List<Hildon.Button> ();
                foreach (Plugin plugin in CinaestProgram.plugins) {
                        var button = new Gtk.Button.with_label (plugin.get_name ());
@@ -52,7 +54,13 @@ class SettingsDialog : Gtk.Dialog {
                        Hildon.gtk_widget_set_theme_size (button, SizeType.FINGER_HEIGHT);
                        button.set_alignment(0, 0.5f);
 
-                       vbox.pack_start (button, true, true, 0);
+                       if (i++ == 0) {
+                               hbox = new HBox (true, 0);
+                               vbox.pack_start (hbox, true, true, 0);
+                       }
+                       if (i == 2)
+                               i = 0;
+                       hbox.pack_start (button, true, true, 0);
 
                        button.clicked.connect (on_plugin_settings);