summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2013-09-21 19:28:04 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2013-09-21 19:30:04 +0900
commitd2028f692b4a61a93a07e5af9ca24b562c46af0d (patch)
tree34e5fe1201c274084ab9e03c9491419f1617c0f5
parent54ed83e08cb7880e26e1ae67f030253af339e8da (diff)
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.
-rw-r--r--ChangeLog3
-rw-r--r--NEWS1
-rw-r--r--src/bin/test_hover.c9
-rw-r--r--src/lib/elm_hover.c7
-rw-r--r--src/lib/elm_hover.h1
5 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 30c6ce5..989ee94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1637,3 +1637,6 @@
1637 elm_widget_item_part_text_custom_get(), 1637 elm_widget_item_part_text_custom_get(),
1638 elm_widget_item_part_text_custom_update() 1638 elm_widget_item_part_text_custom_update()
1639 1639
16402013-09-21 Daniel Juyung Seo (SeoZ)
1641
1642 * hover: added "dismissed" callback.
diff --git a/NEWS b/NEWS
index e448406..061bae4 100644
--- a/NEWS
+++ b/NEWS
@@ -91,6 +91,7 @@ Additions:
91 * Add "selected,invalid" smart callback for fileselector. 91 * Add "selected,invalid" smart callback for fileselector.
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 95
95Improvements: 96Improvements:
96 97
diff --git a/src/bin/test_hover.c b/src/bin/test_hover.c
index c7e76c3..61d4f52 100644
--- a/src/bin/test_hover.c
+++ b/src/bin/test_hover.c
@@ -1,6 +1,14 @@
1#include "elementary_config.h" 1#include "elementary_config.h"
2#include <Elementary.h> 2#include <Elementary.h>
3#ifndef ELM_LIB_QUICKLAUNCH 3#ifndef ELM_LIB_QUICKLAUNCH
4
5static void
6_dismissed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
7 void *event_info EINA_UNUSED)
8{
9 printf("hover dismissed callback is called!\n");
10}
11
4static void 12static void
5my_hover_bt(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 13my_hover_bt(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
6{ 14{
@@ -34,6 +42,7 @@ test_hover(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_inf
34 evas_object_show(bx); 42 evas_object_show(bx);
35 43
36 hv = elm_hover_add(win); 44 hv = elm_hover_add(win);
45 evas_object_smart_callback_add(hv, "dismissed", _dismissed_cb, NULL);
37 46
38 bt = elm_button_add(win); 47 bt = elm_button_add(win);
39 elm_object_text_set(bt, "Button"); 48 elm_object_text_set(bt, "Button");
diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c
index 0e4c49c..1e9fd14 100644
--- a/src/lib/elm_hover.c
+++ b/src/lib/elm_hover.c
@@ -46,6 +46,7 @@ const Elm_Layout_Part_Alias_Description _content_aliases[] =
46 46
47#define ELM_PRIV_HOVER_SIGNALS(cmd) \ 47#define ELM_PRIV_HOVER_SIGNALS(cmd) \
48 cmd(SIG_CLICKED, "clicked", "") \ 48 cmd(SIG_CLICKED, "clicked", "") \
49 cmd(SIG_DISMISSED, "dismissed", "") \
49 cmd(SIG_SMART_LOCATION_CHANGED, "smart,changed", "") 50 cmd(SIG_SMART_LOCATION_CHANGED, "smart,changed", "")
50 51
51ELM_PRIV_HOVER_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE); 52ELM_PRIV_HOVER_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
@@ -533,6 +534,7 @@ _hov_dismiss_cb(void *data,
533{ 534{
534 evas_object_hide(data); 535 evas_object_hide(data);
535 evas_object_smart_callback_call(data, SIG_CLICKED, NULL); 536 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
537 evas_object_smart_callback_call(data, SIG_DISMISSED, NULL);
536} 538}
537 539
538static void 540static void
@@ -577,7 +579,10 @@ _elm_hover_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
577 sd->on_del = EINA_TRUE; 579 sd->on_del = EINA_TRUE;
578 580
579 if (evas_object_visible_get(obj)) 581 if (evas_object_visible_get(obj))
580 evas_object_smart_callback_call(obj, SIG_CLICKED, NULL); 582 {
583 evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
584 evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
585 }
581 586
582 elm_hover_target_set(obj, NULL); 587 elm_hover_target_set(obj, NULL);
583 588
diff --git a/src/lib/elm_hover.h b/src/lib/elm_hover.h
index db37590..7d6ea0a 100644
--- a/src/lib/elm_hover.h
+++ b/src/lib/elm_hover.h
@@ -33,6 +33,7 @@
33 * This widget emits the following signals, besides the ones sent from 33 * This widget emits the following signals, besides the ones sent from
34 * @ref Layout: 34 * @ref Layout:
35 * @li @c "clicked" - the user clicked the empty space in the hover to dismiss 35 * @li @c "clicked" - the user clicked the empty space in the hover to dismiss
36 * @li @c "dismissed" - the user clicked the empty space in the hover to dismiss (since 1.8)
36 * @li @c "smart,changed" - a content object placed under the "smart" 37 * @li @c "smart,changed" - a content object placed under the "smart"
37 * policy was replaced to a new slot direction. 38 * policy was replaced to a new slot direction.
38 * @li @c "focused" - When the hover has received focus. (since 1.8) 39 * @li @c "focused" - When the hover has received focus. (since 1.8)