forked from enlightenment/efl
elm_menu: 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:
parent
42f3e07308
commit
a7cd873410
|
@ -1640,3 +1640,7 @@
|
||||||
2013-09-21 Daniel Juyung Seo (SeoZ)
|
2013-09-21 Daniel Juyung Seo (SeoZ)
|
||||||
|
|
||||||
* hover: added "dismissed" callback.
|
* hover: added "dismissed" callback.
|
||||||
|
|
||||||
|
2013-09-21 Daniel Juyung Seo (SeoZ)
|
||||||
|
|
||||||
|
* menu: added "dismissed" callback.
|
||||||
|
|
|
@ -92,6 +92,7 @@ Additions:
|
||||||
* elm_object_item : Introduces new APIs, elm_object_item_track(), elm_object_item_untrack(), elm_object_item_track_get().
|
* 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 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.
|
* Add "dismissed" smart callback for hover.
|
||||||
|
* Add "dismissed" smart callback for menu.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#ifndef ELM_LIB_QUICKLAUNCH
|
#ifndef ELM_LIB_QUICKLAUNCH
|
||||||
|
|
||||||
|
static void
|
||||||
|
_menu_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
|
void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
printf("menu dismissed callback is called!\n");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_menu_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
_menu_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
void *event_info)
|
void *event_info)
|
||||||
|
@ -118,6 +125,8 @@ test_menu(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
evas_object_show(rect);
|
evas_object_show(rect);
|
||||||
|
|
||||||
menu = elm_menu_add(win);
|
menu = elm_menu_add(win);
|
||||||
|
evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb, NULL);
|
||||||
|
|
||||||
elm_menu_item_add(menu, NULL, NULL, "first item", NULL, NULL);
|
elm_menu_item_add(menu, NULL, NULL, "first item", NULL, NULL);
|
||||||
|
|
||||||
menu_it = elm_menu_item_add(menu, NULL, "mail-reply-all", "second item",
|
menu_it = elm_menu_item_add(menu, NULL, "mail-reply-all", "second item",
|
||||||
|
|
|
@ -14,7 +14,8 @@ EAPI Eo_Op ELM_OBJ_MENU_BASE_ID = EO_NOOP;
|
||||||
#define MY_CLASS_NAME "elm_menu"
|
#define MY_CLASS_NAME "elm_menu"
|
||||||
|
|
||||||
#define ELM_PRIV_MENU_SIGNALS(cmd) \
|
#define ELM_PRIV_MENU_SIGNALS(cmd) \
|
||||||
cmd(SIG_CLICKED, "clicked", "")
|
cmd(SIG_CLICKED, "clicked", "") \
|
||||||
|
cmd(SIG_DISMISSED, "dismissed", "")
|
||||||
|
|
||||||
ELM_PRIV_MENU_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
|
ELM_PRIV_MENU_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
|
||||||
|
|
||||||
|
@ -391,6 +392,7 @@ _hover_dismissed_cb(void *data,
|
||||||
{
|
{
|
||||||
_menu_hide(data, obj, event_info);
|
_menu_hide(data, obj, event_info);
|
||||||
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
|
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
|
||||||
|
evas_object_smart_callback_call(data, SIG_DISMISSED, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
*
|
*
|
||||||
* Signals that you can add callbacks for are:
|
* Signals that you can add callbacks for are:
|
||||||
* @li @c "clicked" - the user clicked the empty space in the menu to dismiss.
|
* @li @c "clicked" - the user clicked the empty space in the menu to dismiss.
|
||||||
|
* @li @c "dismissed" - the user clicked the empty space in the menu to dismiss (since 1.8)
|
||||||
*
|
*
|
||||||
* Default content parts of the menu items that you can use for are:
|
* Default content parts of the menu items that you can use for are:
|
||||||
* @li @c "default" - A main content of the menu item
|
* @li @c "default" - A main content of the menu item
|
||||||
|
|
Loading…
Reference in New Issue