discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5c6db42a08ada6958e2ddc3d55f44ad7ff7f3639

commit 5c6db42a08ada6958e2ddc3d55f44ad7ff7f3639
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Tue Dec 29 13:22:17 2015 -0500

    add shelf callback for hidden state and trigger extra hide-on-show if hiding
    
    if shown while a hide animation is running, evas will prevent further show
    intercept callbacks from being reached, resulting in a permanently hidden
    shelf
    
    this shortcuts the (current) hide animation in order to begin showing the 
object
---
 src/bin/e_shelf.c | 9 +++++++++
 src/bin/e_shelf.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c
index df5a219..b955b18 100644
--- a/src/bin/e_shelf.c
+++ b/src/bin/e_shelf.c
@@ -211,6 +211,12 @@ e_shelf_zone_dummy_new(E_Zone *zone, Evas_Object *obj, int 
id)
 
    return es;
 }
+static void
+_e_shelf_hidden(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UNUSED)
+{
+   E_Shelf *es = data;
+   es->hiding = 0;
+}
 
 E_API E_Shelf *
 e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, E_Layer 
layer, int id)
@@ -249,6 +255,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char 
*style, E_Layer laye
    if (layer == E_LAYER_DESKTOP)
      type = E_COMP_OBJECT_TYPE_NONE;
    es->comp_object = e_comp_object_util_add(es->o_base, type);
+   evas_object_event_callback_add(es->comp_object, EVAS_CALLBACK_HIDE, 
_e_shelf_hidden, es);
    evas_object_data_set(es->comp_object, "E_Shelf", es);
    evas_object_data_set(es->comp_object, "comp_skip", (void*)1);
    evas_object_name_set(es->comp_object, es->name);
@@ -365,6 +372,7 @@ e_shelf_show(E_Shelf *es)
 {
    E_OBJECT_CHECK(es);
    E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
+   if (es->hiding) evas_object_hide(es->comp_object);
    evas_object_show(es->comp_object);
 }
 
@@ -374,6 +382,7 @@ e_shelf_hide(E_Shelf *es)
    E_OBJECT_CHECK(es);
    E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
    evas_object_hide(es->comp_object);
+   es->hiding = evas_object_visible_get(es->comp_object);
 }
 
 E_API void
diff --git a/src/bin/e_shelf.h b/src/bin/e_shelf.h
index 5f19ddc..e0ac359 100644
--- a/src/bin/e_shelf.h
+++ b/src/bin/e_shelf.h
@@ -49,6 +49,7 @@ struct _E_Shelf
    unsigned char        dummy : 1;
    Eina_Bool            cfg_delete : 1;
    unsigned int         locked;
+   Eina_Bool hiding : 1;
 };
 
 typedef struct E_Event_Shelf

-- 


Reply via email to