From 5c6db42a08ada6958e2ddc3d55f44ad7ff7f3639 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 29 Dec 2015 13:22:17 -0500 Subject: [PATCH] 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 df5a21988..b955b18e9 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 5f19ddc9e..e0ac3593b 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