summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2015-10-12 13:22:26 -0700
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commit12508e08f17da77cf223fc79880ca3398c052f0f (patch)
tree136fdaabb06adc1d66d7e038b2fc3868af957022
parentbbe9c3b205eaa06a4f6a6fa7e3590e637335c8d9 (diff)
elm_hoversel: fix to show dismiss animation
Summary: In hover.edc, hoversel dismiss animations are defined, but it doesn't work at all. (Hover is removed before animation) This patch makes hoversel remove its hover after dismiss animation. @fix Test Plan: elementary_test hoversel Reviewers: Hermet, cedric Reviewed By: cedric Subscribers: woohyun Differential Revision: https://phab.enlightenment.org/D3070 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elc_hoversel.c73
-rw-r--r--src/lib/elm_hover.c7
2 files changed, 69 insertions, 11 deletions
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 266dc0031..2079e99c2 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -93,10 +93,15 @@ _elm_hoversel_elm_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd)
93 93
94static Eina_Bool 94static Eina_Bool
95_on_hover_clicked(void *data EINA_UNUSED, 95_on_hover_clicked(void *data EINA_UNUSED,
96 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, 96 Eo *obj, const Eo_Event_Description *desc EINA_UNUSED,
97 void *event_info EINA_UNUSED) 97 void *event_info EINA_UNUSED)
98{ 98{
99 elm_hoversel_hover_end(data); 99 const char *dismissstr;
100
101 dismissstr = edje_object_data_get(elm_layout_edje_get(obj), "dismiss");
102
103 if (!dismissstr || strcmp(dismissstr, "on"))
104 elm_hoversel_hover_end(data); // for backward compatibility
100 105
101 return EINA_TRUE; 106 return EINA_TRUE;
102} 107}
@@ -323,6 +328,37 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd)
323} 328}
324 329
325static void 330static void
331_hover_end_finished(void *data,
332 Evas_Object *obj EINA_UNUSED,
333 const char *emission EINA_UNUSED,
334 const char *source EINA_UNUSED)
335{
336 Elm_Object_Item *eo_item;
337 Eina_List *l;
338 const char *dismissstr;
339
340 ELM_HOVERSEL_DATA_GET(data, sd);
341
342 dismissstr = edje_object_data_get(elm_layout_edje_get(sd->hover), "dismiss");
343
344 if (dismissstr && !strcmp(dismissstr, "on"))
345 {
346 sd->expanded = EINA_FALSE;
347
348 EINA_LIST_FOREACH(sd->items, l, eo_item)
349 {
350 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it);
351 VIEW(it) = NULL;
352 }
353 ELM_SAFE_FREE(sd->hover, evas_object_del);
354 sd->scr = NULL;
355 sd->last_location = NULL;
356
357 eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL));
358 }
359}
360
361static void
326_activate(Evas_Object *obj) 362_activate(Evas_Object *obj)
327{ 363{
328 Elm_Object_Item *eo_item; 364 Elm_Object_Item *eo_item;
@@ -355,6 +391,8 @@ _activate(Evas_Object *obj)
355 391
356 eo_do(sd->hover, eo_event_callback_add 392 eo_do(sd->hover, eo_event_callback_add
357 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_hover_clicked, obj)); 393 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_hover_clicked, obj));
394 elm_layout_signal_callback_add
395 (sd->hover, "elm,action,hide,finished", "elm", _hover_end_finished, obj);
358 elm_hover_target_set(sd->hover, obj); 396 elm_hover_target_set(sd->hover, obj);
359 397
360 /* hover's content */ 398 /* hover's content */
@@ -695,23 +733,38 @@ _elm_hoversel_hover_begin(Eo *obj, Elm_Hoversel_Data *sd)
695EOLIAN static void 733EOLIAN static void
696_elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd) 734_elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd)
697{ 735{
736
698 Elm_Object_Item *eo_item; 737 Elm_Object_Item *eo_item;
699 Eina_List *l; 738 Eina_List *l;
739 const char *dismissstr;
700 740
701 if (!sd->hover) return; 741 if (!sd->hover) return;
702 742
703 sd->expanded = EINA_FALSE; 743 dismissstr = edje_object_data_get(elm_layout_edje_get(sd->hover), "dismiss");
704 744
705 EINA_LIST_FOREACH(sd->items, l, eo_item) 745 if (dismissstr && !strcmp(dismissstr, "on"))
706 { 746 {
707 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); 747 elm_hover_dismiss(sd->hover);
708 VIEW(it) = NULL; 748
749
750
709 } 751 }
710 ELM_SAFE_FREE(sd->hover, evas_object_del); 752 else
711 sd->scr = NULL; 753
712 sd->last_location = NULL; 754 {
755 sd->expanded = EINA_FALSE;
756
757 EINA_LIST_FOREACH(sd->items, l, eo_item)
758 {
759 ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it);
760 VIEW(it) = NULL;
761 }
762 ELM_SAFE_FREE(sd->hover, evas_object_del);
763 sd->scr = NULL;
764 sd->last_location = NULL;
713 765
714 eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL)); 766 eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL));
767 } // for backward compatibility
715} 768}
716 769
717EOLIAN static Eina_Bool 770EOLIAN static Eina_Bool
diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c
index 7bfc6dbb5..2ca235a36 100644
--- a/src/lib/elm_hover.c
+++ b/src/lib/elm_hover.c
@@ -808,7 +808,12 @@ _elm_hover_best_content_location_get(const Eo *obj EINA_UNUSED, Elm_Hover_Data *
808EOLIAN static void 808EOLIAN static void
809_elm_hover_dismiss(Eo *obj, Elm_Hover_Data *_pd EINA_UNUSED) 809_elm_hover_dismiss(Eo *obj, Elm_Hover_Data *_pd EINA_UNUSED)
810{ 810{
811 elm_layout_signal_emit(obj, "elm,action,dismiss", ""); // XXX: for compat 811 const char *dismissstr;
812
813 dismissstr = edje_object_data_get(elm_layout_edje_get(obj), "dismiss");
814
815 if (!dismissstr || strcmp(dismissstr, "on"))
816 elm_layout_signal_emit(obj, "elm,action,dismiss", ""); // XXX: for compat
812 elm_layout_signal_emit(obj, "elm,action,dismiss", "elm"); 817 elm_layout_signal_emit(obj, "elm,action,dismiss", "elm");
813} 818}
814 819