2008-08-06 Claudio Saavedra <csaavedra@igalia.com>
authorClaudio Saavedra <csaavedra@igalia.com>
Thu, 7 Aug 2008 01:56:21 +0000 (01:56 +0000)
committerClaudio Saavedra <csaavedra@igalia.com>
Thu, 7 Aug 2008 01:56:21 +0000 (01:56 +0000)
* src/hildon-touch-selector.h:
* examples/hildon-picker-button-multicolumn-example.c:
(hildon_touch_selector_append_text_column): Add a gboolean
parameter to determine if text must be centered in the column.

* src/hildon-date-selector.c: (hildon_date_selector_init):
* src/hildon-time-selector.c: (hildon_time_selector_init):
* src/hildon-touch-selector.c: (hildon_touch_selector_new_text),
(create_touch_selector): Update widgets and example to reflect
the API change.

ChangeLog
examples/hildon-picker-button-multicolumn-example.c
src/hildon-date-selector.c
src/hildon-time-selector.c
src/hildon-touch-selector.c
src/hildon-touch-selector.h

index f07d778..2086477 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2008-08-06  Claudio Saavedra  <csaavedra@igalia.com>
 
+       * src/hildon-touch-selector.h:
+       * examples/hildon-picker-button-multicolumn-example.c:
+       (hildon_touch_selector_append_text_column): Add a gboolean
+       parameter to determine if text must be centered in the column.
+
+       * src/hildon-date-selector.c: (hildon_date_selector_init):
+       * src/hildon-time-selector.c: (hildon_time_selector_init):
+       * src/hildon-touch-selector.c: (hildon_touch_selector_new_text),
+       (create_touch_selector): Update widgets and example to reflect
+       the API change.
+
+2008-08-06  Claudio Saavedra  <csaavedra@igalia.com>
+
        * src/hildon-touch-selector.c:
        (hildon_touch_selector_set_active_iter): Set also the cursor in
        the active row.
index 01ce000..1d8c752 100644 (file)
@@ -46,7 +46,7 @@ create_touch_selector (void)
   gtk_list_store_set (model, &iter, 0, "Mailbox", -1);
 
   hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                            GTK_TREE_MODEL (model));
+                                            GTK_TREE_MODEL (model), TRUE);
 
   model = gtk_list_store_new (1, G_TYPE_STRING);
 
@@ -60,7 +60,7 @@ create_touch_selector (void)
   gtk_list_store_set (model, &iter, 0, "Smoke signals", -1);
 
   hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                            GTK_TREE_MODEL (model));
+                                            GTK_TREE_MODEL (model), TRUE);
   return selector;
 }
 
index a27ef38..e7bd707 100644 (file)
@@ -244,15 +244,15 @@ hildon_date_selector_init (HildonDateSelector * selector)
     switch (current_item) {
     case DAY:
       hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                                selector->priv->day_model);
+                                                selector->priv->day_model, TRUE);
       break;
     case MONTH:
       hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                                selector->priv->month_model);
+                                                selector->priv->month_model, TRUE);
       break;
     case YEAR:
       hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                                selector->priv->year_model);
+                                                selector->priv->year_model, TRUE);
       break;
     default:
       g_error ("Current column order incorrect");
index 3d60531..d876333 100644 (file)
@@ -151,16 +151,16 @@ hildon_time_selector_init (HildonTimeSelector * selector)
   selector->priv->minutes_model = _create_minutes_model (selector);
 
   hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                            selector->priv->hours_model);
+                                            selector->priv->hours_model, TRUE);
 
   hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                            selector->priv->minutes_model);
+                                            selector->priv->minutes_model, TRUE);
 
   if (selector->priv->ampm_format) {
     selector->priv->ampm_model = _create_ampm_model (selector);
 
     hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                              selector->priv->ampm_model);
+                                              selector->priv->ampm_model, TRUE);
 
     g_signal_connect (G_OBJECT (selector),
                       "changed", G_CALLBACK (_manage_ampm_selection_cb),
index e5d7f1e..e253665 100644 (file)
@@ -472,7 +472,7 @@ hildon_touch_selector_new_text (void)
   store = gtk_list_store_new (1, G_TYPE_STRING);
 
   hildon_touch_selector_append_text_column (HILDON_TOUCH_SELECTOR (selector),
-                                            GTK_TREE_MODEL (store));
+                                            GTK_TREE_MODEL (store), TRUE);
 
   return selector;
 }
@@ -608,6 +608,7 @@ hildon_touch_selector_append_column (HildonTouchSelector * selector,
  * hildon_touch_selector_append_text_column
  * @selector: the #HildonTouchSelector widget
  * @model: the #GtkTreeModel with the data of the column
+ * @center: whether to center the text on the column.
  *
  * Equivalent to hildon_touch_selector_append_column, but using a
  * default text cell renderer. This is the most common use of the
@@ -617,7 +618,7 @@ hildon_touch_selector_append_column (HildonTouchSelector * selector,
  **/
 gboolean
 hildon_touch_selector_append_text_column (HildonTouchSelector * selector,
-                                          GtkTreeModel * model)
+                                          GtkTreeModel * model, gboolean center)
 {
   GtkCellRenderer *renderer = NULL;
   GValue val = { 0, };
@@ -628,10 +629,12 @@ hildon_touch_selector_append_text_column (HildonTouchSelector * selector,
   if (model != NULL) {
     renderer = gtk_cell_renderer_text_new ();
 
-    g_value_init (&val, G_TYPE_FLOAT);
-    g_value_set_float (&val, 0.5);
-    /* FIXME: center the text, this should be configurable */
-    g_object_set_property (G_OBJECT (renderer), "xalign", &val);
+    if (center) {
+      g_value_init (&val, G_TYPE_FLOAT);
+      g_value_set_float (&val, 0.5);
+      /* FIXME: center the text, this should be configurable */
+      g_object_set_property (G_OBJECT (renderer), "xalign", &val);
+    }
 
     return hildon_touch_selector_append_column (selector, model, renderer,
                                                 "text", 0, NULL);
index 1aa3183..065edcc 100644 (file)
@@ -81,7 +81,7 @@ void hildon_touch_selector_insert_text    (HildonTouchSelector * selector,
 
 /* column related  */
 gboolean hildon_touch_selector_append_text_column     (HildonTouchSelector * selector,
-                                                       GtkTreeModel * model);
+                                                       GtkTreeModel * model, gboolean center);
 
 gboolean hildon_touch_selector_append_column          (HildonTouchSelector * selector,
                                                        GtkTreeModel * model,