[clutter] interactive/image-box: Clarify the label contents
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] interactive/image-box: Clarify the label contents
- Date: Fri, 16 Mar 2012 16:20:08 +0000 (UTC)
commit de32ba1ddfa73901fea0146ec462754a420659b0
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Fri Mar 16 15:05:42 2012 +0000
interactive/image-box: Clarify the label contents
tests/interactive/test-image-box.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/tests/interactive/test-image-box.c b/tests/interactive/test-image-box.c
index f35363c..abcd22c 100644
--- a/tests/interactive/test-image-box.c
+++ b/tests/interactive/test-image-box.c
@@ -31,8 +31,13 @@ on_clicked (ClutterClickAction *action,
ClutterActor *actor,
ClutterText *label)
{
+ gchar *str;
+
clutter_actor_set_content_gravity (actor, gravities[cur_gravity].gravity);
- clutter_text_set_text (label, gravities[cur_gravity].name);
+
+ str = g_strconcat ("Content gravity: ", gravities[cur_gravity].name, NULL);
+ clutter_text_set_text (label, str);
+ g_free (str);
cur_gravity += 1;
@@ -53,6 +58,7 @@ test_image_box_main (int argc, char *argv[])
ClutterContent *image;
ClutterAction *action;
GdkPixbuf *pixbuf;
+ gchar *str;
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return EXIT_FAILURE;
@@ -93,11 +99,17 @@ test_image_box_main (int argc, char *argv[])
clutter_actor_set_content (box, image);
g_object_unref (image);
+ str = g_strconcat ("Content gravity: ",
+ gravities[n_gravities - 1].name,
+ NULL);
+
text = clutter_text_new ();
- clutter_text_set_text (CLUTTER_TEXT (text), gravities[n_gravities - 1].name);
+ clutter_text_set_text (CLUTTER_TEXT (text), str);
clutter_actor_add_constraint (text, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
clutter_actor_add_child (stage, text);
+ g_free (str);
+
action = clutter_click_action_new ();
g_signal_connect (action, "clicked", G_CALLBACK (on_clicked), text);
clutter_actor_set_reactive (box, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]