From 3005d87c975f3bafe692dd71e56cc85400056fc0 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Sat, 21 Sep 2013 19:28:04 +0900 Subject: [PATCH] elm_hover: added "dismissed" smart callback for dismiss action. - "clicked" smart callback was used for dismiss action. - "clicked" should be removed in EFL 2.0. Updated "EFL 2.0 TODO" wiki page. - Updated ChangeLog and NEWS. - Added sample code to elementary_test. - Updated documentation. --- legacy/elementary/ChangeLog | 3 +++ legacy/elementary/NEWS | 1 + legacy/elementary/src/bin/test_hover.c | 9 +++++++++ legacy/elementary/src/lib/elm_hover.c | 7 ++++++- legacy/elementary/src/lib/elm_hover.h | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 30c6ce5..989ee94 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -1637,3 +1637,6 @@ elm_widget_item_part_text_custom_get(), elm_widget_item_part_text_custom_update() +2013-09-21 Daniel Juyung Seo (SeoZ) + + * hover: added "dismissed" callback. diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index e448406..061bae4 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -91,6 +91,7 @@ Additions: * Add "selected,invalid" smart callback for fileselector. * elm_object_item : Introduces new APIs, elm_object_item_track(), elm_object_item_untrack(), elm_object_item_track_get(). * Add elm_widget_item_part_text_custom_set(), elm_widget_item_part_text_custom_get(), elm_widget_item_part_text_custom_update(). + * Add "dismissed" smart callback for hover. Improvements: diff --git a/legacy/elementary/src/bin/test_hover.c b/legacy/elementary/src/bin/test_hover.c index c7e76c3..61d4f52 100644 --- a/legacy/elementary/src/bin/test_hover.c +++ b/legacy/elementary/src/bin/test_hover.c @@ -1,6 +1,14 @@ #include "elementary_config.h" #include #ifndef ELM_LIB_QUICKLAUNCH + +static void +_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + printf("hover dismissed callback is called!\n"); +} + static void my_hover_bt(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -34,6 +42,7 @@ test_hover(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf evas_object_show(bx); hv = elm_hover_add(win); + evas_object_smart_callback_add(hv, "dismissed", _dismissed_cb, NULL); bt = elm_button_add(win); elm_object_text_set(bt, "Button"); diff --git a/legacy/elementary/src/lib/elm_hover.c b/legacy/elementary/src/lib/elm_hover.c index 0e4c49c..1e9fd14 100644 --- a/legacy/elementary/src/lib/elm_hover.c +++ b/legacy/elementary/src/lib/elm_hover.c @@ -46,6 +46,7 @@ const Elm_Layout_Part_Alias_Description _content_aliases[] = #define ELM_PRIV_HOVER_SIGNALS(cmd) \ cmd(SIG_CLICKED, "clicked", "") \ + cmd(SIG_DISMISSED, "dismissed", "") \ cmd(SIG_SMART_LOCATION_CHANGED, "smart,changed", "") ELM_PRIV_HOVER_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE); @@ -533,6 +534,7 @@ _hov_dismiss_cb(void *data, { evas_object_hide(data); evas_object_smart_callback_call(data, SIG_CLICKED, NULL); + evas_object_smart_callback_call(data, SIG_DISMISSED, NULL); } static void @@ -577,7 +579,10 @@ _elm_hover_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) sd->on_del = EINA_TRUE; if (evas_object_visible_get(obj)) - evas_object_smart_callback_call(obj, SIG_CLICKED, NULL); + { + evas_object_smart_callback_call(obj, SIG_CLICKED, NULL); + evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL); + } elm_hover_target_set(obj, NULL); diff --git a/legacy/elementary/src/lib/elm_hover.h b/legacy/elementary/src/lib/elm_hover.h index db37590..7d6ea0a 100644 --- a/legacy/elementary/src/lib/elm_hover.h +++ b/legacy/elementary/src/lib/elm_hover.h @@ -33,6 +33,7 @@ * This widget emits the following signals, besides the ones sent from * @ref Layout: * @li @c "clicked" - the user clicked the empty space in the hover to dismiss + * @li @c "dismissed" - the user clicked the empty space in the hover to dismiss (since 1.8) * @li @c "smart,changed" - a content object placed under the "smart" * policy was replaced to a new slot direction. * @li @c "focused" - When the hover has received focus. (since 1.8) -- 2.7.4