Add pannable area and pack better.
[tweakr] / maemo-tweaks.c
index aa0568b..45a9223 100644 (file)
@@ -5,6 +5,7 @@
 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
 #include <gtk/gtk.h>
 #include <hildon/hildon-note.h>
+#include <hildon/hildon-pannable-area.h>
 
 #include "maemo-tweaks-types.h"
 #include "libmaemo-tweaks-section/maemo-tweaks-section.h"
@@ -38,6 +39,8 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
                        gboolean user_activated)
 {
     GtkWidget *dialog;
+    GtkWidget *panarea;
+    GtkWidget *box;
     gint response;
 
     MaemoTweaksModuleManager *manager;
@@ -54,6 +57,12 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
     section_types = g_type_children (MAEMO_TWEAKS_TYPE_SECTION, &n_sections);
 
     dialog = create_dialog (GTK_WINDOW (data));
+    panarea = hildon_pannable_area_new ();
+    box = gtk_vbox_new (FALSE, 0);
+
+    hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA (panarea),
+                                            box);
+    g_object_set (G_OBJECT (panarea), "height-request", 350, NULL);
 
     for (i = 0; i < n_sections; i++)
     {
@@ -64,16 +73,18 @@ osso_return_t execute (osso_context_t *osso, gpointer data,
         section = maemo_tweaks_section_new (section_types[i]);
 
         sections = g_list_prepend (sections, section);
-        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+        gtk_box_pack_start (GTK_BOX (box),
                             gtk_label_new (section->name),
-                            TRUE, TRUE, 0);
-        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
+                            FALSE, FALSE, 0);
+        gtk_box_pack_start (GTK_BOX (box),
                             maemo_tweaks_section_get_widget (section),
-                            TRUE, TRUE, 0);
+                            FALSE, FALSE, 0);
 
         g_type_class_unref (klass);
     }
 
+    gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), panarea,
+                        FALSE, FALSE, 0);
     gtk_widget_show_all (GTK_DIALOG (dialog)->vbox);
 
     for (;;)