Add pannable area and pack better.
authorSalvatore Iovene <salvatore@iovene.com>
Wed, 9 Dec 2009 19:52:31 +0000 (21:52 +0200)
committerSalvatore Iovene <salvatore@iovene.com>
Wed, 9 Dec 2009 19:52:31 +0000 (21:52 +0200)
maemo-tweaks.c
modules/maemo-tweaks-desktop.c
modules/maemo-tweaks-mce.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 (;;)
index 4dab65c..12e1fc7 100644 (file)
@@ -203,7 +203,7 @@ maemo_tweaks_desktop_section_init (MaemoTweaksDesktopSection *section)
     iface->name = "Desktop";
     iface->widget = gtk_vbox_new (FALSE, 0);
     gtk_box_pack_start (GTK_BOX (iface->widget), section->snap_button,
-                        TRUE, TRUE, 0);
+                        FALSE, FALSE, 0);
 }
 
 static void
index 4435b4b..276d9fa 100644 (file)
@@ -331,11 +331,11 @@ maemo_tweaks_mce_section_init (MaemoTweaksMceSection *section)
     iface->name = "Mce";
     iface->widget = gtk_vbox_new (FALSE, 0);
     gtk_box_pack_start (GTK_BOX (iface->widget), section->short_power_key,
-                        TRUE, TRUE, 0);
+                        FALSE, FALSE, 0);
     gtk_box_pack_start (GTK_BOX (iface->widget), section->long_power_key,
-                        TRUE, TRUE, 0);
+                        FALSE, FALSE, 0);
     gtk_box_pack_start (GTK_BOX (iface->widget), section->double_power_key,
-                        TRUE, TRUE, 0);
+                        FALSE, FALSE, 0);
 }
 
 static void