2 * vim:ts=4:sw=4:et:cindent:cino=(0
5 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
7 #include <hildon/hildon-picker-button.h>
9 GtkWidget * create_desktop_snap_to_grid (void)
11 const gchar *options[] = {"Default", "Small grid", "Large grid", NULL};
13 GtkWidget *button, *selector;
15 selector = hildon_touch_selector_new_text ();
16 while (options[i] && options[i] != '\0')
18 hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector),
22 button = hildon_picker_button_new (HILDON_SIZE_AUTO,
23 HILDON_BUTTON_ARRANGEMENT_VERTICAL);
25 hildon_button_set_title (HILDON_BUTTON (button),
26 "Snap desktop icons to grid");
28 hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
29 HILDON_TOUCH_SELECTOR (selector));
31 gtk_widget_show (button);
35 GtkWidget *create_dialog (GtkWindow *parent)
40 dialog = gtk_dialog_new_with_buttons
43 GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
50 box = GTK_DIALOG (dialog)->vbox;
51 gtk_box_pack_start (GTK_BOX (box), create_desktop_snap_to_grid (),
58 osso_return_t execute (osso_context_t *osso, gpointer data,
59 gboolean user_activated)
64 dialog = create_dialog (GTK_WINDOW (data));
65 response = gtk_dialog_run (GTK_DIALOG (dialog));
66 if (response == GTK_RESPONSE_OK)
70 gtk_widget_destroy (GTK_WIDGET (dialog));