+2008-10-30 Alejandro Pinheiro <apinheiro@igalia.com>
+
+ * src/hildon-picker-dialog.c:
+ Defined a utility macro with the desired touch selector height
+ Removed currently unused separator, and title_label variables from
+ private structure.
+ (hildon_picker_dialog_init): Removed code related to the creation
+ of unused private variables title_label and separator.
+ (_hildon_picker_dialog_set_selector): Added gtk_widget_set_size_request
+ to ensure correct visualization of the touch selector inside the dialog.
+ * src/hildon-touch-selector.c
+ (hildon_touch_selector_init): Removed a gtk_widget_set_size_request to
+ ensure a concrete height of the widget.
+
2008-10-30 Claudio Saavedra <csaavedra@igalia.com>
* src/Makefile.am:
G_DEFINE_TYPE (HildonPickerDialog, hildon_picker_dialog, HILDON_TYPE_DIALOG)
+#define HILDON_TOUCH_SELECTOR_HEIGHT 320
+
struct _HildonPickerDialogPrivate
{
GtkWidget *selector;
- GtkWidget *separator;
GtkWidget *button;
- GtkWidget *title_label;
-
gulong signal_id;
};
static void
hildon_picker_dialog_init (HildonPickerDialog * dialog)
{
- GtkWidget *separator = NULL;
-
dialog->priv = HILDON_PICKER_DIALOG_GET_PRIVATE (dialog);
dialog->priv->selector = NULL;
hildon_dialog_add_button (HILDON_DIALOG (dialog), "", GTK_RESPONSE_OK);
gtk_widget_grab_default (dialog->priv->button);
- dialog->priv->title_label = gtk_label_new ("default value");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- dialog->priv->title_label, FALSE, FALSE, 0);
- separator = gtk_hseparator_new ();
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- separator, FALSE, FALSE, 0);
-
dialog->priv->signal_id = 0;
-
-/* gtk_widget_show (dialog->priv->title_label); */
-/* gtk_widget_show (separator); */
}
new_title = hildon_touch_selector_get_current_text (selector);
- if (dialog->priv->title_label != NULL) {
-/* gtk_label_set_text (GTK_LABEL(selector->priv->title_label), new_title); */
- }
gtk_window_set_title (GTK_WINDOW (dialog), new_title);
g_free (new_title);
gtk_container_remove (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
dialog->priv->selector);
g_object_unref (dialog->priv->selector);
+ gtk_widget_set_size_request (GTK_WIDGET (dialog->priv->selector), -1, 320);
dialog->priv->selector = NULL;
}
if (dialog->priv->selector != NULL) {
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
dialog->priv->selector, TRUE, TRUE, 0);
+
+ /* NOTE: this is a little hackish, but required at this moment
+ in order to ensure a correct height visualization */
+ gtk_widget_set_size_request (GTK_WIDGET (dialog->priv->selector), -1,
+ HILDON_TOUCH_SELECTOR_HEIGHT);
+
gtk_widget_show (dialog->priv->selector);
g_object_ref (dialog->priv->selector);
}