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.
This commit is contained in:
Daniel Juyung Seo 2013-09-21 19:28:04 +09:00
parent bea0320461
commit 3005d87c97
5 changed files with 20 additions and 1 deletions

View File

@ -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.

View File

@ -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:

View File

@ -1,6 +1,14 @@
#include "elementary_config.h"
#include <Elementary.h>
#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");

View File

@ -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);

View File

@ -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)