projects
/
hildon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code cleanups in HildonTouchSelector
[hildon]
/
src
/
hildon-touch-selector.c
diff --git
a/src/hildon-touch-selector.c
b/src/hildon-touch-selector.c
index
6c6ba34
..
26b7e13
100644
(file)
--- a/
src/hildon-touch-selector.c
+++ b/
src/hildon-touch-selector.c
@@
-692,9
+692,6
@@
_create_new_column (HildonTouchSelector * selector,
g_object_set (G_OBJECT (panarea),
"initial-hint", FALSE, NULL);
g_object_set (G_OBJECT (panarea),
"initial-hint", FALSE, NULL);
- hildon_pannable_area_set_size_request_policy (HILDON_PANNABLE_AREA (panarea),
- HILDON_SIZE_REQUEST_CHILDREN);
-
gtk_container_add (GTK_CONTAINER (panarea), GTK_WIDGET (tv));
new_column->priv->model = model;
gtk_container_add (GTK_CONTAINER (panarea), GTK_WIDGET (tv));
new_column->priv->model = model;
@@
-1082,8
+1079,8
@@
hildon_touch_selector_prepend_text (HildonTouchSelector * selector,
* @position: the position to insert @text.
* @text: A non %NULL text string.
*
* @position: the position to insert @text.
* @text: A non %NULL text string.
*
- * Inserts a new entry in particular position of a #HildoTouchSelector created
- * with hildon_touch_selector_new_text().
+ * Inserts a new entry in a particular position of a
+ * #HildonTouchSelector created with hildon_touch_selector_new_text().
*
* Since: 2.2
**/
*
* Since: 2.2
**/
@@
-1199,26
+1196,20
@@
HildonTouchSelectorColumn*
hildon_touch_selector_append_text_column (HildonTouchSelector * selector,
GtkTreeModel * model, gboolean center)
{
hildon_touch_selector_append_text_column (HildonTouchSelector * selector,
GtkTreeModel * model, gboolean center)
{
- GtkCellRenderer *renderer = NULL;
- GValue val = { 0, };
+ gfloat xalign = center ? 0.5 : 0.0;
+ GtkCellRenderer *renderer;
g_return_val_if_fail (HILDON_IS_TOUCH_SELECTOR (selector), NULL);
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
g_return_val_if_fail (HILDON_IS_TOUCH_SELECTOR (selector), NULL);
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
- if (model != NULL) {
- renderer = gtk_cell_renderer_text_new ();
+ renderer = gtk_cell_renderer_text_new ();
- if (center) {
- g_value_init (&val, G_TYPE_FLOAT);
- g_value_set_float (&val, 0.5);
- g_object_set_property (G_OBJECT (renderer), "xalign", &val);
- }
+ g_object_set (renderer,
+ "xalign", xalign,
+ NULL);
- return hildon_touch_selector_append_column (selector, model, renderer,
- "text", 0, NULL);
- } else {
- return NULL;
- }
+ return hildon_touch_selector_append_column (selector, model, renderer,
+ "text", 0, NULL);
}
/**
}
/**