seoz pushed a commit to branch master.
commit a52b461984914211ee98f390b957b0c370347bfc
Author: Thiep Ha <[email protected]>
Date: Fri Jul 12 06:57:00 2013 +0900
sldkfj
---
ChangeLog | 4 +++
NEWS | 1 +
data/themes/widgets/notify.edc | 71 +++++++++++++++++++++++++++++++++++++-----
src/lib/elm_notify.c | 27 ++++++++++++++--
src/lib/elm_widget_notify.h | 2 ++
5 files changed, 94 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 881226d..f58cf80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1495,3 +1495,7 @@
2013-07-06 Shinwoo Kim
* Add elm_access_highlight_next_set, export
elm_widget_focus_region_show
+
+2013-07-07 Thiep Ha
+
+ * Add hide effect for notify.
diff --git a/NEWS b/NEWS
index 72ff2bf..afff798 100644
--- a/NEWS
+++ b/NEWS
@@ -122,6 +122,7 @@ Improvements:
* Move cursor when mouse moves with longpress.
* Show magnifier when selection handlers are pressed or moved.
* Change the method to calculate a distance which be scrolled from linear
to sine curve.
+ * Add hide effect for notify.
Fixes:
* 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 32bdd54..339b59e 100644
--- a/data/themes/widgets/notify.edc
+++ b/data/themes/widgets/notify.edc
@@ -96,9 +96,15 @@ group { name: "elm/notify/top/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -139,6 +145,13 @@ group { name: "elm/notify/center/default";
}
}
}
+ programs {
+ program { name: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
+ }
+ }
}
group { name: "elm/notify/bottom/default";
//this group is a design similar to the inwin group
@@ -219,9 +232,15 @@ group { name: "elm/notify/bottom/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -304,9 +323,15 @@ group { name: "elm/notify/left/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -389,9 +414,15 @@ group { name: "elm/notify/right/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -474,9 +505,15 @@ group { name: "elm/notify/top_left/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -559,9 +596,15 @@ group { name: "elm/notify/top_right/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -644,9 +687,15 @@ group { name: "elm/notify/bottom_left/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
@@ -729,9 +778,15 @@ group { name: "elm/notify/bottom_right/default";
transition: LINEAR 0.5;
}
program { name: "hide";
- signal: "hide";
+ signal: "elm,state,hide";
+ source: "elm";
action: STATE_SET "default" 0.0;
target: "base";
+ transition: LINEAR 0.5;
+ after: "hide_finished";
+ }
+ program { name: "hide_finished";
+ action: SIGNAL_EMIT "elm,action,hide,finished" "";
}
}
}
diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c
index a43d573..d1744ad 100644
--- a/src/lib/elm_notify.c
+++ b/src/lib/elm_notify.c
@@ -248,7 +248,8 @@ _timer_cb(void *data)
sd->timer = NULL;
if (!evas_object_visible_get(obj)) goto end;
- evas_object_hide(obj);
+ sd->in_timeout = EINA_TRUE;
+ edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
evas_object_smart_callback_call(obj, SIG_TIMEOUT, NULL);
end:
@@ -271,6 +272,8 @@ _elm_notify_smart_show(Eo *obj, void *_pd, va_list *list
EINA_UNUSED)
{
Elm_Notify_Smart_Data *sd = _pd;
+ sd->had_hidden = EINA_FALSE;
+ sd->in_timeout = EINA_FALSE;
eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
evas_object_show(sd->notify);
@@ -284,10 +287,12 @@ _elm_notify_smart_hide(Eo *obj, void *_pd, va_list *list
EINA_UNUSED)
{
Elm_Notify_Smart_Data *sd = _pd;
+ if (sd->had_hidden && !sd->in_timeout)
+ return;
eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
- evas_object_hide(sd->notify);
- if (!sd->allow_events) evas_object_hide(sd->block_events);
+ if (!sd->in_timeout)
+ edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
ELM_SAFE_FREE(sd->timer, ecore_timer_del);
}
@@ -434,6 +439,18 @@ _elm_notify_smart_content_unset(Eo *obj, void *_pd,
va_list *list)
}
static void
+_hide_finished_cb(void *data,
+ Evas_Object *obj __UNUSED__,
+ const char *emission __UNUSED__,
+ const char *source __UNUSED__)
+{
+ ELM_NOTIFY_DATA_GET(data, sd);
+ sd->had_hidden = EINA_TRUE;
+ evas_object_hide(sd->notify);
+ if (!sd->allow_events) evas_object_hide(sd->block_events);
+}
+
+static void
_elm_notify_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Notify_Smart_Data *priv = _pd;
@@ -448,6 +465,8 @@ _elm_notify_smart_add(Eo *obj, void *_pd, va_list *list
EINA_UNUSED)
evas_object_event_callback_add
(obj, EVAS_CALLBACK_RESTACK, _restack_cb, obj);
+ edje_object_signal_callback_add
+ (priv->notify, "elm,action,hide,finished","", _hide_finished_cb, obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_notify_align_set(obj, 0.5, 0.0);
@@ -458,6 +477,8 @@ _elm_notify_smart_del(Eo *obj, void *_pd, va_list *list
EINA_UNUSED)
{
Elm_Notify_Smart_Data *sd = _pd;
+ edje_object_signal_callback_del_full
+ (sd->notify, "elm,action,hide,finished", "", _hide_finished_cb, obj);
elm_notify_parent_set(obj, NULL);
elm_notify_allow_events_set(obj, EINA_FALSE);
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 701bb45..ac6c006 100644
--- a/src/lib/elm_widget_notify.h
+++ b/src/lib/elm_widget_notify.h
@@ -28,6 +28,8 @@ struct _Elm_Notify_Smart_Data
Ecore_Timer *timer;
Eina_Bool allow_events : 1;
+ Eina_Bool had_hidden : 1;
+ Eina_Bool in_timeout : 1;
};
/**
--
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk