summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2013-08-22 05:16:07 +0900
committerDaniel Juyung Seo <seojuyung@gmail.com>2013-08-22 05:24:50 +0900
commit5c4bc2f561de7f02a014f97108c49657bd8e2a88 (patch)
treeb0c6aaf1cae2a415277585a887ac667d877e03e6
parent03385c4d84bd0f13c6adab321cdf9c90ea8e9647 (diff)
notify: Add hide effect to notify.
As specified in task T149, the notify has show effect but does not have hide effect. This patch adds hide effect to notify.
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--data/themes/widgets/notify.edc85
-rw-r--r--src/lib/elm_notify.c46
-rw-r--r--src/lib/elm_widget_notify.h2
5 files changed, 127 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index e63d26d86..562e0598a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1511,6 +1511,7 @@
1511 not entry. This prevents the asynchronous states between ime and 1511 not entry. This prevents the asynchronous states between ime and
1512 conformant. 1512 conformant.
1513 1513
1514<<<<<<< HEAD
15142013-07-23 ChunEon Park (Hermet) 15152013-07-23 ChunEon Park (Hermet)
1515 1516
1516 * File Selector : Support elm_object_part_text_set() for the ok, cancel 1517 * File Selector : Support elm_object_part_text_set() for the ok, cancel
@@ -1562,3 +1563,7 @@
15622013-08-19 ChunEon Park (Hermet) 15632013-08-19 ChunEon Park (Hermet)
1563 1564
1564 * Popup: Support "language,changed" smart callback. 1565 * Popup: Support "language,changed" smart callback.
1566
15672013-08-22 Thiep Ha
1568
1569 * Add hide effect for notify.
diff --git a/NEWS b/NEWS
index e9abab7e7..2fac39eba 100644
--- a/NEWS
+++ b/NEWS
@@ -127,6 +127,7 @@ Improvements:
127 * Change the method to calculate a distance which be scrolled from linear to sine curve. 127 * Change the method to calculate a distance which be scrolled from linear to sine curve.
128 * Add support for URL in Elm_Image and Elm_Photocam. 128 * Add support for URL in Elm_Image and Elm_Photocam.
129 * Popup: Support "language,changed" smart callback. 129 * Popup: Support "language,changed" smart callback.
130 * Add hide effect for notify.
130 131
131Fixes: 132Fixes:
132 * Now elm_datetime_field_limit_set() can set year limits wihtout problems. 133 * Now elm_datetime_field_limit_set() can set year limits wihtout problems.
diff --git a/data/themes/widgets/notify.edc b/data/themes/widgets/notify.edc
index 6409fa807..e06b45643 100644
--- a/data/themes/widgets/notify.edc
+++ b/data/themes/widgets/notify.edc
@@ -19,6 +19,7 @@ group { name: "elm/notify/block_events/default";
19} 19}
20group { name: "elm/notify/top/default"; 20group { name: "elm/notify/top/default";
21 //this group is a design similar to the inwin group 21 //this group is a design similar to the inwin group
22 data.item: "emit_hide_finished_signal" "yes";
22 images { 23 images {
23 image: "shad_circ.png" COMP; 24 image: "shad_circ.png" COMP;
24 image: "bt_dis_base.png" COMP; 25 image: "bt_dis_base.png" COMP;
@@ -96,14 +97,21 @@ group { name: "elm/notify/top/default";
96 transition: LINEAR 0.5; 97 transition: LINEAR 0.5;
97 } 98 }
98 program { name: "hide"; 99 program { name: "hide";
99 signal: "hide"; 100 signal: "elm,state,hide";
101 source: "elm";
100 action: STATE_SET "default" 0.0; 102 action: STATE_SET "default" 0.0;
101 target: "base"; 103 target: "base";
104 transition: LINEAR 0.5;
105 after: "hide_finished";
106 }
107 program { name: "hide_finished";
108 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
102 } 109 }
103 } 110 }
104} 111}
105group { name: "elm/notify/center/default"; 112group { name: "elm/notify/center/default";
106 //this group is a design similar to the inwin group 113 //this group is a design similar to the inwin group
114 data.item: "emit_hide_finished_signal" "yes";
107 images { 115 images {
108 image: "bt_dis_base.png" COMP; 116 image: "bt_dis_base.png" COMP;
109 } 117 }
@@ -145,10 +153,14 @@ group { name: "elm/notify/center/default";
145 type: RECT; 153 type: RECT;
146 description { state: "default" 0.0; 154 description { state: "default" 0.0;
147 color: 0 0 0 0 ; 155 color: 0 0 0 0 ;
156 rel1.relative: 0.0 -1.0;
157 rel2.relative: 1.0 0.0;
148 } 158 }
149 description { state: "visible" 0.0; 159 description { state: "visible" 0.0;
150 inherit: "default" 0.0; 160 inherit: "default" 0.0;
151 color: 255 255 255 255; 161 color: 255 255 255 255;
162 rel1.relative: 0.0 0.0;
163 rel2.relative: 1.0 1.0;
152 } 164 }
153 } 165 }
154 } 166 }
@@ -160,15 +172,22 @@ group { name: "elm/notify/center/default";
160 transition: LINEAR 0.5; 172 transition: LINEAR 0.5;
161 } 173 }
162 program { name: "hide"; 174 program { name: "hide";
163 signal: "hide"; 175 signal: "elm,state,hide";
176 source: "elm";
164 action: STATE_SET "default" 0.0; 177 action: STATE_SET "default" 0.0;
165 target: "clipper"; 178 target: "clipper";
179 transition: LINEAR 0.5;
180 after: "hide_finished";
181 }
182 program { name: "hide_finished";
183 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
166 } 184 }
167 } 185 }
168} 186}
169 187
170group { name: "elm/notify/bottom/default"; 188group { name: "elm/notify/bottom/default";
171 //this group is a design similar to the inwin group 189 //this group is a design similar to the inwin group
190 data.item: "emit_hide_finished_signal" "yes";
172 images { 191 images {
173 image: "shad_circ.png" COMP; 192 image: "shad_circ.png" COMP;
174 image: "bt_dis_base.png" COMP; 193 image: "bt_dis_base.png" COMP;
@@ -246,14 +265,21 @@ group { name: "elm/notify/bottom/default";
246 transition: LINEAR 0.5; 265 transition: LINEAR 0.5;
247 } 266 }
248 program { name: "hide"; 267 program { name: "hide";
249 signal: "hide"; 268 signal: "elm,state,hide";
269 source: "elm";
250 action: STATE_SET "default" 0.0; 270 action: STATE_SET "default" 0.0;
251 target: "base"; 271 target: "base";
272 transition: LINEAR 0.5;
273 after: "hide_finished";
274 }
275 program { name: "hide_finished";
276 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
252 } 277 }
253 } 278 }
254} 279}
255group { name: "elm/notify/left/default"; 280group { name: "elm/notify/left/default";
256 //this group is a design similar to the inwin group 281 //this group is a design similar to the inwin group
282 data.item: "emit_hide_finished_signal" "yes";
257 images { 283 images {
258 image: "shad_circ.png" COMP; 284 image: "shad_circ.png" COMP;
259 image: "bt_dis_base.png" COMP; 285 image: "bt_dis_base.png" COMP;
@@ -331,14 +357,21 @@ group { name: "elm/notify/left/default";
331 transition: LINEAR 0.5; 357 transition: LINEAR 0.5;
332 } 358 }
333 program { name: "hide"; 359 program { name: "hide";
334 signal: "hide"; 360 signal: "elm,state,hide";
361 source: "elm";
335 action: STATE_SET "default" 0.0; 362 action: STATE_SET "default" 0.0;
336 target: "base"; 363 target: "base";
364 transition: LINEAR 0.5;
365 after: "hide_finished";
366 }
367 program { name: "hide_finished";
368 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
337 } 369 }
338 } 370 }
339} 371}
340group { name: "elm/notify/right/default"; 372group { name: "elm/notify/right/default";
341 //this group is a design similar to the inwin group 373 //this group is a design similar to the inwin group
374 data.item: "emit_hide_finished_signal" "yes";
342 images { 375 images {
343 image: "shad_circ.png" COMP; 376 image: "shad_circ.png" COMP;
344 image: "bt_dis_base.png" COMP; 377 image: "bt_dis_base.png" COMP;
@@ -416,14 +449,21 @@ group { name: "elm/notify/right/default";
416 transition: LINEAR 0.5; 449 transition: LINEAR 0.5;
417 } 450 }
418 program { name: "hide"; 451 program { name: "hide";
419 signal: "hide"; 452 signal: "elm,state,hide";
453 source: "elm";
420 action: STATE_SET "default" 0.0; 454 action: STATE_SET "default" 0.0;
421 target: "base"; 455 target: "base";
456 transition: LINEAR 0.5;
457 after: "hide_finished";
458 }
459 program { name: "hide_finished";
460 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
422 } 461 }
423 } 462 }
424} 463}
425group { name: "elm/notify/top_left/default"; 464group { name: "elm/notify/top_left/default";
426 //this group is a design similar to the inwin group 465 //this group is a design similar to the inwin group
466 data.item: "emit_hide_finished_signal" "yes";
427 images { 467 images {
428 image: "shad_circ.png" COMP; 468 image: "shad_circ.png" COMP;
429 image: "bt_dis_base.png" COMP; 469 image: "bt_dis_base.png" COMP;
@@ -501,14 +541,21 @@ group { name: "elm/notify/top_left/default";
501 transition: LINEAR 0.5; 541 transition: LINEAR 0.5;
502 } 542 }
503 program { name: "hide"; 543 program { name: "hide";
504 signal: "hide"; 544 signal: "elm,state,hide";
545 source: "elm";
505 action: STATE_SET "default" 0.0; 546 action: STATE_SET "default" 0.0;
506 target: "base"; 547 target: "base";
548 transition: LINEAR 0.5;
549 after: "hide_finished";
550 }
551 program { name: "hide_finished";
552 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
507 } 553 }
508 } 554 }
509} 555}
510group { name: "elm/notify/top_right/default"; 556group { name: "elm/notify/top_right/default";
511 //this group is a design similar to the inwin group 557 //this group is a design similar to the inwin group
558 data.item: "emit_hide_finished_signal" "yes";
512 images { 559 images {
513 image: "shad_circ.png" COMP; 560 image: "shad_circ.png" COMP;
514 image: "bt_dis_base.png" COMP; 561 image: "bt_dis_base.png" COMP;
@@ -586,14 +633,21 @@ group { name: "elm/notify/top_right/default";
586 transition: LINEAR 0.5; 633 transition: LINEAR 0.5;
587 } 634 }
588 program { name: "hide"; 635 program { name: "hide";
589 signal: "hide"; 636 signal: "elm,state,hide";
637 source: "elm";
590 action: STATE_SET "default" 0.0; 638 action: STATE_SET "default" 0.0;
591 target: "base"; 639 target: "base";
640 transition: LINEAR 0.5;
641 after: "hide_finished";
642 }
643 program { name: "hide_finished";
644 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
592 } 645 }
593 } 646 }
594} 647}
595group { name: "elm/notify/bottom_left/default"; 648group { name: "elm/notify/bottom_left/default";
596 //this group is a design similar to the inwin group 649 //this group is a design similar to the inwin group
650 data.item: "emit_hide_finished_signal" "yes";
597 images { 651 images {
598 image: "shad_circ.png" COMP; 652 image: "shad_circ.png" COMP;
599 image: "bt_dis_base.png" COMP; 653 image: "bt_dis_base.png" COMP;
@@ -671,14 +725,21 @@ group { name: "elm/notify/bottom_left/default";
671 transition: LINEAR 0.5; 725 transition: LINEAR 0.5;
672 } 726 }
673 program { name: "hide"; 727 program { name: "hide";
674 signal: "hide"; 728 signal: "elm,state,hide";
729 source: "elm";
675 action: STATE_SET "default" 0.0; 730 action: STATE_SET "default" 0.0;
676 target: "base"; 731 target: "base";
732 transition: LINEAR 0.5;
733 after: "hide_finished";
734 }
735 program { name: "hide_finished";
736 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
677 } 737 }
678 } 738 }
679} 739}
680group { name: "elm/notify/bottom_right/default"; 740group { name: "elm/notify/bottom_right/default";
681 //this group is a design similar to the inwin group 741 //this group is a design similar to the inwin group
742 data.item: "emit_hide_finished_signal" "yes";
682 images { 743 images {
683 image: "shad_circ.png" COMP; 744 image: "shad_circ.png" COMP;
684 image: "bt_dis_base.png" COMP; 745 image: "bt_dis_base.png" COMP;
@@ -756,9 +817,15 @@ group { name: "elm/notify/bottom_right/default";
756 transition: LINEAR 0.5; 817 transition: LINEAR 0.5;
757 } 818 }
758 program { name: "hide"; 819 program { name: "hide";
759 signal: "hide"; 820 signal: "elm,state,hide";
821 source: "elm";
760 action: STATE_SET "default" 0.0; 822 action: STATE_SET "default" 0.0;
761 target: "base"; 823 target: "base";
824 transition: LINEAR 0.5;
825 after: "hide_finished";
826 }
827 program { name: "hide_finished";
828 action: SIGNAL_EMIT "elm,action,hide,finished" "elm";
762 } 829 }
763 } 830 }
764} 831}
diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c
index 46c361aae..231f6a928 100644
--- a/src/lib/elm_notify.c
+++ b/src/lib/elm_notify.c
@@ -241,6 +241,7 @@ _elm_notify_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
241static Eina_Bool 241static Eina_Bool
242_timer_cb(void *data) 242_timer_cb(void *data)
243{ 243{
244 const char *hide_signal;
244 Evas_Object *obj = data; 245 Evas_Object *obj = data;
245 246
246 ELM_NOTIFY_DATA_GET(obj, sd); 247 ELM_NOTIFY_DATA_GET(obj, sd);
@@ -248,7 +249,16 @@ _timer_cb(void *data)
248 sd->timer = NULL; 249 sd->timer = NULL;
249 if (!evas_object_visible_get(obj)) goto end; 250 if (!evas_object_visible_get(obj)) goto end;
250 251
251 evas_object_hide(obj); 252 hide_signal = edje_object_data_get(sd->notify, "emit_hide_finished_signal");
253 if ((hide_signal) && (!strcmp(hide_signal, "yes")))
254 {
255 sd->in_timeout = EINA_TRUE;
256 edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
257 }
258 else //for backport supporting: edc without emitting hide finished signal
259 {
260 evas_object_hide(obj);
261 }
252 evas_object_smart_callback_call(obj, SIG_TIMEOUT, NULL); 262 evas_object_smart_callback_call(obj, SIG_TIMEOUT, NULL);
253 263
254end: 264end:
@@ -271,6 +281,8 @@ _elm_notify_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
271{ 281{
272 Elm_Notify_Smart_Data *sd = _pd; 282 Elm_Notify_Smart_Data *sd = _pd;
273 283
284 sd->had_hidden = EINA_FALSE;
285 sd->in_timeout = EINA_FALSE;
274 eo_do_super(obj, MY_CLASS, evas_obj_smart_show()); 286 eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
275 287
276 evas_object_show(sd->notify); 288 evas_object_show(sd->notify);
@@ -282,12 +294,24 @@ _elm_notify_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
282static void 294static void
283_elm_notify_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 295_elm_notify_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
284{ 296{
297 const char *hide_signal;
285 Elm_Notify_Smart_Data *sd = _pd; 298 Elm_Notify_Smart_Data *sd = _pd;
286 299
300 if (sd->had_hidden && !sd->in_timeout)
301 return;
287 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide()); 302 eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
288 303
289 evas_object_hide(sd->notify); 304 hide_signal = edje_object_data_get(sd->notify, "emit_hide_finished_signal");
290 if (!sd->allow_events) evas_object_hide(sd->block_events); 305 if ((hide_signal) && (!strcmp(hide_signal, "yes")))
306 {
307 if (!sd->in_timeout)
308 edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
309 }
310 else //for backport supporting: edc without emitting hide finished signal
311 {
312 evas_object_hide(sd->notify);
313 if (sd->allow_events) evas_object_hide(sd->block_events);
314 }
291 ELM_SAFE_FREE(sd->timer, ecore_timer_del); 315 ELM_SAFE_FREE(sd->timer, ecore_timer_del);
292} 316}
293 317
@@ -434,6 +458,18 @@ _elm_notify_smart_content_unset(Eo *obj, void *_pd, va_list *list)
434} 458}
435 459
436static void 460static void
461_hide_finished_cb(void *data,
462 Evas_Object *obj __UNUSED__,
463 const char *emission __UNUSED__,
464 const char *source __UNUSED__)
465{
466 ELM_NOTIFY_DATA_GET(data, sd);
467 sd->had_hidden = EINA_TRUE;
468 evas_object_hide(sd->notify);
469 if (!sd->allow_events) evas_object_hide(sd->block_events);
470}
471
472static void
437_elm_notify_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 473_elm_notify_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
438{ 474{
439 Elm_Notify_Smart_Data *priv = _pd; 475 Elm_Notify_Smart_Data *priv = _pd;
@@ -448,6 +484,8 @@ _elm_notify_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
448 484
449 evas_object_event_callback_add 485 evas_object_event_callback_add
450 (obj, EVAS_CALLBACK_RESTACK, _restack_cb, obj); 486 (obj, EVAS_CALLBACK_RESTACK, _restack_cb, obj);
487 edje_object_signal_callback_add
488 (priv->notify, "elm,action,hide,finished", "elm", _hide_finished_cb, obj);
451 489
452 elm_widget_can_focus_set(obj, EINA_FALSE); 490 elm_widget_can_focus_set(obj, EINA_FALSE);
453 elm_notify_align_set(obj, 0.5, 0.0); 491 elm_notify_align_set(obj, 0.5, 0.0);
@@ -458,6 +496,8 @@ _elm_notify_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
458{ 496{
459 Elm_Notify_Smart_Data *sd = _pd; 497 Elm_Notify_Smart_Data *sd = _pd;
460 498
499 edje_object_signal_callback_del_full
500 (sd->notify, "elm,action,hide,finished", "elm", _hide_finished_cb, obj);
461 elm_notify_parent_set(obj, NULL); 501 elm_notify_parent_set(obj, NULL);
462 elm_notify_allow_events_set(obj, EINA_FALSE); 502 elm_notify_allow_events_set(obj, EINA_FALSE);
463 if (sd->timer) ecore_timer_del(sd->timer); 503 if (sd->timer) ecore_timer_del(sd->timer);
diff --git a/src/lib/elm_widget_notify.h b/src/lib/elm_widget_notify.h
index 701bb45a7..ac6c00683 100644
--- a/src/lib/elm_widget_notify.h
+++ b/src/lib/elm_widget_notify.h
@@ -28,6 +28,8 @@ struct _Elm_Notify_Smart_Data
28 Ecore_Timer *timer; 28 Ecore_Timer *timer;
29 29
30 Eina_Bool allow_events : 1; 30 Eina_Bool allow_events : 1;
31 Eina_Bool had_hidden : 1;
32 Eina_Bool in_timeout : 1;
31}; 33};
32 34
33/** 35/**