2008-10-30 Alejandro Pinheiro <apinheiro@igalia.com>
authorAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 30 Oct 2008 17:04:34 +0000 (17:04 +0000)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Thu, 30 Oct 2008 17:04:34 +0000 (17:04 +0000)
* 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.

ChangeLog
src/hildon-picker-dialog.c
src/hildon-touch-selector.c

index fc7569c..ce3c20e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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:
index 2a7bea8..548acf7 100644 (file)
 
 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;
 };
 
@@ -145,8 +144,6 @@ hildon_picker_dialog_class_init (HildonPickerDialogClass * class)
 static void
 hildon_picker_dialog_init (HildonPickerDialog * dialog)
 {
-  GtkWidget *separator = NULL;
-
   dialog->priv = HILDON_PICKER_DIALOG_GET_PRIVATE (dialog);
 
   dialog->priv->selector = NULL;
@@ -154,17 +151,7 @@ hildon_picker_dialog_init (HildonPickerDialog * dialog)
     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); */
 }
 
 
@@ -230,9 +217,6 @@ _update_title_on_selector_changed_cb (HildonTouchSelector * selector,
 
   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);
@@ -305,6 +289,7 @@ _hildon_picker_dialog_set_selector (HildonPickerDialog * dialog,
     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;
   }
 
@@ -313,6 +298,12 @@ _hildon_picker_dialog_set_selector (HildonPickerDialog * dialog,
   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);
   }
index 5d7f3d5..a2b0617 100644 (file)
@@ -298,10 +298,6 @@ hildon_touch_selector_init (HildonTouchSelector * selector)
   gtk_box_pack_end (GTK_BOX (selector), selector->priv->hbox,
                     TRUE, TRUE, 0);
   gtk_widget_show (selector->priv->hbox);
-
-  /* FIXME: this is the correct height? A fixed height is the correct 
-     implementation */
-  gtk_widget_set_size_request (GTK_WIDGET (selector), -1, 320);
 }
 
 /*