diff options
author | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-07-20 01:46:35 +0900 |
---|---|---|
committer | Daniel Juyung Seo <seojuyung2@gmail.com> | 2014-07-20 01:46:35 +0900 |
commit | 29bd265dc453c135f4ce9ad6fc8b54868347b839 (patch) | |
tree | 99a36c4135141607f47735fec19a1b8794d59bc3 /src/lib | |
parent | 41748e9df246af09e19c5cd017621340de1f2be2 (diff) |
toolbar: added selected and unselected smartcallbacks to toolbar.
- Item based widget should emit this signal. This is good for the
consistency and makes application developers easy to guess.
- Added test case to elementary_test -> toolbar
@feature
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/elm_toolbar.c | 6 | ||||
-rw-r--r-- | src/lib/elm_toolbar.eo | 2 | ||||
-rw-r--r-- | src/lib/elm_toolbar.h | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 047dce33a..fdaa4e07f 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c | |||
@@ -26,6 +26,8 @@ static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop"; | |||
26 | static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start"; | 26 | static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start"; |
27 | static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop"; | 27 | static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop"; |
28 | static const char SIG_CLICKED[] = "clicked"; | 28 | static const char SIG_CLICKED[] = "clicked"; |
29 | static const char SIG_SELECTED[] = "selected"; | ||
30 | static const char SIG_UNSELECTED[] = "unselected"; | ||
29 | static const char SIG_LONGPRESSED[] = "longpressed"; | 31 | static const char SIG_LONGPRESSED[] = "longpressed"; |
30 | static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; | 32 | static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; |
31 | static const char SIG_ITEM_FOCUSED[] = "item,focused"; | 33 | static const char SIG_ITEM_FOCUSED[] = "item,focused"; |
@@ -37,6 +39,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { | |||
37 | {SIG_SCROLL_DRAG_START, ""}, | 39 | {SIG_SCROLL_DRAG_START, ""}, |
38 | {SIG_SCROLL_DRAG_STOP, ""}, | 40 | {SIG_SCROLL_DRAG_STOP, ""}, |
39 | {SIG_CLICKED, ""}, | 41 | {SIG_CLICKED, ""}, |
42 | {SIG_SELECTED, ""}, | ||
43 | {SIG_UNSELECTED, ""}, | ||
40 | {SIG_LONGPRESSED, ""}, | 44 | {SIG_LONGPRESSED, ""}, |
41 | {SIG_CLICKED_DOUBLE, ""}, | 45 | {SIG_CLICKED_DOUBLE, ""}, |
42 | {SIG_ITEM_FOCUSED, ""}, | 46 | {SIG_ITEM_FOCUSED, ""}, |
@@ -153,6 +157,7 @@ _item_unselect(Elm_Toolbar_Item *item) | |||
153 | edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm"); | 157 | edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm"); |
154 | if (item->icon) | 158 | if (item->icon) |
155 | elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm"); | 159 | elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm"); |
160 | evas_object_smart_callback_call(WIDGET(item), SIG_UNSELECTED, item); | ||
156 | } | 161 | } |
157 | 162 | ||
158 | static void | 163 | static void |
@@ -1100,6 +1105,7 @@ _item_select(Elm_Toolbar_Item *it) | |||
1100 | if (it->func) it->func((void *)(it->base.data), WIDGET(it), it); | 1105 | if (it->func) it->func((void *)(it->base.data), WIDGET(it), it); |
1101 | } | 1106 | } |
1102 | evas_object_smart_callback_call(obj, SIG_CLICKED, it); | 1107 | evas_object_smart_callback_call(obj, SIG_CLICKED, it); |
1108 | evas_object_smart_callback_call(obj, SIG_SELECTED, it); | ||
1103 | } | 1109 | } |
1104 | 1110 | ||
1105 | static void | 1111 | static void |
diff --git a/src/lib/elm_toolbar.eo b/src/lib/elm_toolbar.eo index 24f38c282..ca49702db 100644 --- a/src/lib/elm_toolbar.eo +++ b/src/lib/elm_toolbar.eo | |||
@@ -523,6 +523,8 @@ class Elm_Toolbar (Elm_Widget, Elm_Interface_Scrollable) | |||
523 | scroll,drag,start; | 523 | scroll,drag,start; |
524 | scroll,drag,stop; | 524 | scroll,drag,stop; |
525 | clicked; | 525 | clicked; |
526 | selected; | ||
527 | unselected; | ||
526 | longpressed; | 528 | longpressed; |
527 | clicked,double; | 529 | clicked,double; |
528 | language,changed; | 530 | language,changed; |
diff --git a/src/lib/elm_toolbar.h b/src/lib/elm_toolbar.h index d80deda62..042d7950c 100644 --- a/src/lib/elm_toolbar.h +++ b/src/lib/elm_toolbar.h | |||
@@ -33,6 +33,10 @@ | |||
33 | * - @c "unfocused" - When the toolbar has lost focus. (since 1.8) | 33 | * - @c "unfocused" - When the toolbar has lost focus. (since 1.8) |
34 | * - @c "item,focused" - When the toolbar item has received focus. (since 1.10) | 34 | * - @c "item,focused" - When the toolbar item has received focus. (since 1.10) |
35 | * - @c "item,unfocused" - When the toolbar item has lost focus. (since 1.10) | 35 | * - @c "item,unfocused" - When the toolbar item has lost focus. (since 1.10) |
36 | * - @c "selected" - when an item is selected. @p event_info is a selected | ||
37 | * item. (since 1.11) | ||
38 | * - @c "unselected" - when an item is unselected. @p event_info is a | ||
39 | * unselected item. (since 1.11) | ||
36 | * | 40 | * |
37 | * Available styles for it: | 41 | * Available styles for it: |
38 | * - @c "default" | 42 | * - @c "default" |