summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2016-03-04 15:42:57 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-03-04 16:14:37 -0800
commitbe923bd58dfcf1dd7e51eceef64afed4a8ce4ce0 (patch)
treebf377cea7a4a2bd572815e6d4a214c826548ec4c
parentdeeb391d18974f5395d149b088e78966fc859aae (diff)
notify: delete unnecessary smart move/resize.
Summary: elm_notify's size is dependent on parent's size. So _elm_notify_evas_object_smart_move/resize() are not necessary. Reviewers: woohyun, jypark, Hermet, minkyu, cedric Reviewed By: cedric Subscribers: minkyu Differential Revision: https://phab.enlightenment.org/D3728 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_notify.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c
index 6c4c3ad99..4a2242572 100644
--- a/src/lib/elm_notify.c
+++ b/src/lib/elm_notify.c
@@ -66,20 +66,18 @@ _notify_theme_apply(Evas_Object *obj)
66 * 66 *
67 * @param obj notification object. 67 * @param obj notification object.
68 * 68 *
69 * @param orient notification orientation. 69 * @param x, y, w, h geometry of object.
70 * 70 *
71 * @internal 71 * @internal
72 **/ 72 **/
73static void 73static void
74_notify_move_to_orientation(Evas_Object *obj) 74_notify_move_to_orientation(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
75{ 75{
76 Evas_Coord minw = -1, minh = -1; 76 Evas_Coord minw = -1, minh = -1;
77 Evas_Coord x, y, w, h;
78 double ax, ay; 77 double ax, ay;
79 78
80 ELM_NOTIFY_DATA_GET(obj, sd); 79 ELM_NOTIFY_DATA_GET(obj, sd);
81 80
82 evas_object_geometry_get(obj, &x, &y, &w, &h);
83 edje_object_size_min_get(sd->notify, &minw, &minh); 81 edje_object_size_min_get(sd->notify, &minw, &minh);
84 edje_object_size_min_restricted_calc(sd->notify, &minw, &minh, minw, minh); 82 edje_object_size_min_restricted_calc(sd->notify, &minw, &minh, minw, minh);
85 83
@@ -94,6 +92,7 @@ _notify_move_to_orientation(Evas_Object *obj)
94 y = y + ((h - minh) * ay); 92 y = y + ((h - minh) * ay);
95 93
96 evas_object_move(sd->notify, x, y); 94 evas_object_move(sd->notify, x, y);
95 evas_object_resize(sd->notify, minw, minh);
97} 96}
98 97
99static void 98static void
@@ -111,9 +110,12 @@ _block_events_theme_apply(Evas_Object *obj)
111static void 110static void
112_mirrored_set(Evas_Object *obj, Eina_Bool rtl) 111_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
113{ 112{
113 Evas_Coord x, y, w, h;
114
114 ELM_NOTIFY_DATA_GET(obj, sd); 115 ELM_NOTIFY_DATA_GET(obj, sd);
115 edje_object_mirrored_set(sd->notify, rtl); 116 edje_object_mirrored_set(sd->notify, rtl);
116 _notify_move_to_orientation(obj); 117 evas_object_geometry_get(obj, &x, &y, &w, &h);
118 _notify_move_to_orientation(obj, x, y, w, h);
117} 119}
118 120
119static void 121static void
@@ -169,7 +171,6 @@ _elm_notify_elm_widget_part_text_get(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd, c
169static void 171static void
170_calc(Evas_Object *obj) 172_calc(Evas_Object *obj)
171{ 173{
172 Evas_Coord minw = -1, minh = -1;
173 Evas_Coord x, y, w, h; 174 Evas_Coord x, y, w, h;
174 175
175 ELM_NOTIFY_DATA_GET(obj, sd); 176 ELM_NOTIFY_DATA_GET(obj, sd);
@@ -178,16 +179,9 @@ _calc(Evas_Object *obj)
178 179
179 evas_object_geometry_get(obj, &x, &y, &w, &h); 180 evas_object_geometry_get(obj, &x, &y, &w, &h);
180 181
181 edje_object_size_min_get(sd->notify, &minw, &minh);
182 edje_object_size_min_restricted_calc(sd->notify, &minw, &minh, minw, minh);
183
184 if (sd->horizontal_align == ELM_NOTIFY_ALIGN_FILL) minw = w;
185 if (sd->vertical_align == ELM_NOTIFY_ALIGN_FILL) minh = h;
186
187 if (sd->content) 182 if (sd->content)
188 { 183 {
189 _notify_move_to_orientation(obj); 184 _notify_move_to_orientation(obj, x, y, w, h);
190 evas_object_resize(sd->notify, minw, minh);
191 } 185 }
192} 186}
193 187
@@ -228,19 +222,31 @@ _block_area_clicked_cb(void *data,
228} 222}
229 223
230EOLIAN static void 224EOLIAN static void
231_elm_notify_evas_object_smart_resize(Eo *obj, Elm_Notify_Data *sd EINA_UNUSED, Evas_Coord w, Evas_Coord h) 225_elm_notify_evas_object_smart_resize(Eo *obj, Elm_Notify_Data *sd, Evas_Coord w, Evas_Coord h)
232{ 226{
227 Evas_Coord x, y;
228
233 evas_obj_smart_resize(eo_super(obj, MY_CLASS), w, h); 229 evas_obj_smart_resize(eo_super(obj, MY_CLASS), w, h);
234 230
235 _calc(obj); 231 if (!sd->parent && sd->content)
232 {
233 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
234 _notify_move_to_orientation(obj, x, y, w, h);
235 }
236} 236}
237 237
238EOLIAN static void 238EOLIAN static void
239_elm_notify_evas_object_smart_move(Eo *obj, Elm_Notify_Data *sd EINA_UNUSED, Evas_Coord x, Evas_Coord y) 239_elm_notify_evas_object_smart_move(Eo *obj, Elm_Notify_Data *sd, Evas_Coord x, Evas_Coord y)
240{ 240{
241 Evas_Coord w, h;
242
241 evas_obj_smart_move(eo_super(obj, MY_CLASS), x, y); 243 evas_obj_smart_move(eo_super(obj, MY_CLASS), x, y);
242 244
243 _calc(obj); 245 if (!sd->parent && sd->content)
246 {
247 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
248 _notify_move_to_orientation(obj, x, y, w, h);
249 }
244} 250}
245 251
246static Eina_Bool 252static Eina_Bool