summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2016-10-14 18:56:17 -0300
committerBruno Dilly <bdilly@profusion.mobi>2016-10-14 18:56:17 -0300
commit9c180007635116623da25e636584d741bff9138c (patch)
treea5cce14d702134b7333a43dab4fed2d49de8ea82
parent5aa51bf2e83fc2ed8541eb14f991f359d9a2248c (diff)
Don't let previous card content be hidden
It shouldn't be required (and it wasn't on the past) For some reason I need to show the content again, after animation is done, otherwise when the next card is flipped content will be hidden.
-rw-r--r--src/bin/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index 7cb523f..a20accd 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -161,6 +161,21 @@ _player_win(Game *game)
161 evas_object_show(popup); 161 evas_object_show(popup);
162} 162}
163 163
164/* FIXME this function shouldn't be required (and it wasn't on the past)
165 For some reason I need to show the content again, after animation is done,
166 otherwise when the next card is flipped content will be hidden */
167static void
168_fl_animate_done(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
169{
170 Evas_Object *ic;
171
172 if (elm_flip_front_visible_get(obj))
173 return;
174
175 ic = elm_object_part_content_get(obj, "back");
176 evas_object_show(ic);
177}
178
164static void 179static void
165_fl_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__) 180_fl_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__)
166{ 181{
@@ -313,6 +328,8 @@ _prepopulate_table(Game *game)
313 elm_table_pack(table, fl, i % game->board_size, i / game->board_size, 328 elm_table_pack(table, fl, i % game->board_size, i / game->board_size,
314 1, 1); 329 1, 1);
315 evas_object_show(fl); 330 evas_object_show(fl);
331 evas_object_smart_callback_add(fl, "animate,done", _fl_animate_done,
332 NULL);
316 game->cards[i].flip = fl; 333 game->cards[i].flip = fl;
317 334
318 bt = elm_button_add(table); 335 bt = elm_button_add(table);