From 08221cbb4144e1f6e2a7cab4e6a8ed5bee7cb785 Mon Sep 17 00:00:00 2001 From: discomfitor Date: Tue, 3 Jan 2012 18:02:56 +0000 Subject: [PATCH] add elm_hover_dismiss() git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66805 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_hover.c | 11 +++++++++++ src/lib/elm_hover.h | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c index 970e32e..61893c9 100644 --- a/src/lib/elm_hover.c +++ b/src/lib/elm_hover.c @@ -852,3 +852,14 @@ elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_ else if (spc_b > spc_r) return _HOV_BOTTOM; return _HOV_LEFT; } + +EAPI void +elm_hover_dismiss(Evas_Object *obj) +{ + Widget_Data *wd; + ELM_CHECK_WIDTYPE(obj, widtype); + wd = elm_widget_data_get(obj); + if (!wd) return; + + edje_object_signal_emit(wd->cov, "elm,action,dismiss", ""); +} diff --git a/src/lib/elm_hover.h b/src/lib/elm_hover.h index 5469c0c..ff2f5b8 100644 --- a/src/lib/elm_hover.h +++ b/src/lib/elm_hover.h @@ -188,5 +188,13 @@ EAPI Evas_Object *elm_hover_content_unset(Evas_Object *obj, const char *swallow) EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis); /** + * @brief Dismiss a hover object + * + * @param obj The hover object + * Use this function to simulate clicking outside the hover to dismiss it. + * In this way, the hover will be hidden and the "clicked" signal will be emitted. + */ +EAPI void elm_hover_dismiss(Evas_Object *obj); +/** * @} */ -- 2.7.4