From 44dca74a0655343e84fb69e4fcaadbc8921bbe21 Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Wed, 9 Dec 2009 21:52:31 +0200 Subject: [PATCH] Add pannable area and pack better. --- maemo-tweaks.c | 19 +++++++++++++++---- modules/maemo-tweaks-desktop.c | 2 +- modules/maemo-tweaks-mce.c | 6 +++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/maemo-tweaks.c b/maemo-tweaks.c index aa0568b..45a9223 100644 --- a/maemo-tweaks.c +++ b/maemo-tweaks.c @@ -5,6 +5,7 @@ #include #include #include +#include #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 (;;) diff --git a/modules/maemo-tweaks-desktop.c b/modules/maemo-tweaks-desktop.c index 4dab65c..12e1fc7 100644 --- a/modules/maemo-tweaks-desktop.c +++ b/modules/maemo-tweaks-desktop.c @@ -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 diff --git a/modules/maemo-tweaks-mce.c b/modules/maemo-tweaks-mce.c index 4435b4b..276d9fa 100644 --- a/modules/maemo-tweaks-mce.c +++ b/modules/maemo-tweaks-mce.c @@ -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 -- 1.7.9.5