summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-10-30 08:49:09 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-10-30 08:49:11 +0900
commit00f667562bbca6b332cc3d6d140df5588c7fefc2 (patch)
tree98ec2684d1980fc7de5f68be52b3e0b38567fcf7
parent6ee48d9a9f3ee14c2594928b0e57c37cead27e44 (diff)
test_image.c: enhance image click example to look better.
- Keep the final state. - Rotate according to the final state.
-rwxr-xr-xsrc/bin/test_image.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/bin/test_image.c b/src/bin/test_image.c
index 311946231..37875ab91 100755
--- a/src/bin/test_image.c
+++ b/src/bin/test_image.c
@@ -137,13 +137,24 @@ static void
137_img_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 137_img_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
138{ 138{
139 Elm_Transit *trans; 139 Elm_Transit *trans;
140 static int degree = 0;
140 141
141 fprintf(stderr, "%p - clicked\n", obj); 142 fprintf(stderr, "%p - clicked\n", obj);
142 143
143 trans = elm_transit_add(); 144 trans = elm_transit_add();
144 elm_transit_object_add(trans, data); 145 elm_transit_object_add(trans, data);
145 elm_transit_effect_rotation_add(trans, 0, 180); 146 if (degree == 0)
146 elm_transit_duration_set(trans, 5.0); 147 {
148 elm_transit_effect_rotation_add(trans, 0, 180);
149 degree = 180;
150 }
151 else
152 {
153 elm_transit_effect_rotation_add(trans, 180, 360);
154 degree = 0;
155 }
156 elm_transit_duration_set(trans, 3.0);
157 elm_transit_objects_final_state_keep_set(trans, EINA_TRUE);
147 elm_transit_go(trans); 158 elm_transit_go(trans);
148} 159}
149 160