bdilly pushed a commit to branch master.

http://git.enlightenment.org/games/econcentration.git/commit/?id=9c180007635116623da25e636584d741bff9138c

commit 9c180007635116623da25e636584d741bff9138c
Author: Bruno Dilly <bdi...@profusion.mobi>
Date:   Fri Oct 14 18:56:17 2016 -0300

    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.
---
 src/bin/main.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

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)
     evas_object_show(popup);
 }
 
+/* FIXME this function 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 */
+static void
+_fl_animate_done(void *data __UNUSED__, Evas_Object *obj, void *event_info 
__UNUSED__)
+{
+    Evas_Object *ic;
+
+    if (elm_flip_front_visible_get(obj))
+        return;
+
+    ic = elm_object_part_content_get(obj, "back");
+    evas_object_show(ic);
+}
+
 static void
 _fl_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__)
 {
@@ -313,6 +328,8 @@ _prepopulate_table(Game *game)
         elm_table_pack(table, fl, i % game->board_size, i / game->board_size,
             1, 1);
         evas_object_show(fl);
+        evas_object_smart_callback_add(fl, "animate,done", _fl_animate_done,
+                                       NULL);
         game->cards[i].flip = fl;
 
         bt = elm_button_add(table);

-- 


Reply via email to