summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-09-21 19:45:12 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-09-21 19:45:12 +0900
commita52d8389c7a249b81b7233fde13a9bceae96245b (patch)
treef7fe29f08acd69b19d73d0a7a084d6961b67bf41
parentaf1b76f4ef5d069a8f38db2ea7386c3e35a786dd (diff)
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.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS1
-rw-r--r--src/bin/test_menu.c9
-rw-r--r--src/lib/elm_menu.c4
-rw-r--r--src/lib/elm_menu.h1
5 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 989ee94db..42f9639a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1640,3 +1640,7 @@
16402013-09-21 Daniel Juyung Seo (SeoZ) 16402013-09-21 Daniel Juyung Seo (SeoZ)
1641 1641
1642 * hover: added "dismissed" callback. 1642 * hover: added "dismissed" callback.
1643
16442013-09-21 Daniel Juyung Seo (SeoZ)
1645
1646 * menu: added "dismissed" callback.
diff --git a/NEWS b/NEWS
index 061bae4ec..2295473b5 100644
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,7 @@ Additions:
92 * elm_object_item : Introduces new APIs, elm_object_item_track(), elm_object_item_untrack(), elm_object_item_track_get(). 92 * elm_object_item : Introduces new APIs, elm_object_item_track(), elm_object_item_untrack(), elm_object_item_track_get().
93 * Add elm_widget_item_part_text_custom_set(), elm_widget_item_part_text_custom_get(), elm_widget_item_part_text_custom_update(). 93 * Add elm_widget_item_part_text_custom_set(), elm_widget_item_part_text_custom_get(), elm_widget_item_part_text_custom_update().
94 * Add "dismissed" smart callback for hover. 94 * Add "dismissed" smart callback for hover.
95 * Add "dismissed" smart callback for menu.
95 96
96Improvements: 97Improvements:
97 98
diff --git a/src/bin/test_menu.c b/src/bin/test_menu.c
index 65a2244c2..9f9fb10cb 100644
--- a/src/bin/test_menu.c
+++ b/src/bin/test_menu.c
@@ -5,6 +5,13 @@
5#ifndef ELM_LIB_QUICKLAUNCH 5#ifndef ELM_LIB_QUICKLAUNCH
6 6
7static void 7static void
8_menu_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
9 void *event_info EINA_UNUSED)
10{
11 printf("menu dismissed callback is called!\n");
12}
13
14static void
8_menu_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 15_menu_show_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
9 void *event_info) 16 void *event_info)
10{ 17{
@@ -118,6 +125,8 @@ test_menu(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
118 evas_object_show(rect); 125 evas_object_show(rect);
119 126
120 menu = elm_menu_add(win); 127 menu = elm_menu_add(win);
128 evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb, NULL);
129
121 elm_menu_item_add(menu, NULL, NULL, "first item", NULL, NULL); 130 elm_menu_item_add(menu, NULL, NULL, "first item", NULL, NULL);
122 131
123 menu_it = elm_menu_item_add(menu, NULL, "mail-reply-all", "second item", 132 menu_it = elm_menu_item_add(menu, NULL, "mail-reply-all", "second item",
diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c
index 44b4a749f..7572473df 100644
--- a/src/lib/elm_menu.c
+++ b/src/lib/elm_menu.c
@@ -14,7 +14,8 @@ EAPI Eo_Op ELM_OBJ_MENU_BASE_ID = EO_NOOP;
14#define MY_CLASS_NAME "elm_menu" 14#define MY_CLASS_NAME "elm_menu"
15 15
16#define ELM_PRIV_MENU_SIGNALS(cmd) \ 16#define ELM_PRIV_MENU_SIGNALS(cmd) \
17 cmd(SIG_CLICKED, "clicked", "") 17 cmd(SIG_CLICKED, "clicked", "") \
18 cmd(SIG_DISMISSED, "dismissed", "")
18 19
19ELM_PRIV_MENU_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE); 20ELM_PRIV_MENU_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
20 21
@@ -391,6 +392,7 @@ _hover_dismissed_cb(void *data,
391{ 392{
392 _menu_hide(data, obj, event_info); 393 _menu_hide(data, obj, event_info);
393 evas_object_smart_callback_call(data, SIG_CLICKED, NULL); 394 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
395 evas_object_smart_callback_call(data, SIG_DISMISSED, NULL);
394} 396}
395 397
396static void 398static void
diff --git a/src/lib/elm_menu.h b/src/lib/elm_menu.h
index 13ba589f8..10cddde61 100644
--- a/src/lib/elm_menu.h
+++ b/src/lib/elm_menu.h
@@ -15,6 +15,7 @@
15 * 15 *
16 * Signals that you can add callbacks for are: 16 * Signals that you can add callbacks for are:
17 * @li @c "clicked" - the user clicked the empty space in the menu to dismiss. 17 * @li @c "clicked" - the user clicked the empty space in the menu to dismiss.
18 * @li @c "dismissed" - the user clicked the empty space in the menu to dismiss (since 1.8)
18 * 19 *
19 * Default content parts of the menu items that you can use for are: 20 * Default content parts of the menu items that you can use for are:
20 * @li @c "default" - A main content of the menu item 21 * @li @c "default" - A main content of the menu item