summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorWooHyun Jung <wh0705.jung@samsung.com>2020-05-18 12:39:59 +0900
committerHermet Park <chuneon.park@samsung.com>2020-05-18 12:39:59 +0900
commitf026000c1eb3967ad123c2239aeb7db3ce70dbf6 (patch)
tree2e9b7164cff527a4eb327868e2ef3f07d2cc552c /src/lib/elementary
parentca169ec71505c1d43a1d4ac793d6a0626667c320 (diff)
efl_ui_image: fix to call "clicked" smart callback when there is no img
Summary: Some applications have used "clicked" smart callback from elm_image which does not have an image in it. To keep backward compatibility, hit_rect needs to be resized properly to call smart callback function. @fix Reviewers: Hermet, jsuya, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11840
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_image.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 7cb96970b0..4dea543391 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -181,6 +181,7 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *img)
181{ 181{
182 Evas_Coord x = 0, y = 0, w = 1, h = 1; 182 Evas_Coord x = 0, y = 0, w = 1, h = 1;
183 int ox, oy, ow, oh; 183 int ox, oy, ow, oh;
184 Eina_Bool img_no_resize = EINA_FALSE;
184 185
185 evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); 186 evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
186 if (efl_isa(img, EFL_CANVAS_LAYOUT_CLASS)) 187 if (efl_isa(img, EFL_CANVAS_LAYOUT_CLASS))
@@ -202,9 +203,7 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *img)
202 //Exception Case 203 //Exception Case
203 if ((iw == 0) || (ih == 0) || (ow == 0) || (oh == 0)) 204 if ((iw == 0) || (ih == 0) || (ow == 0) || (oh == 0))
204 { 205 {
205 evas_object_resize(img, 0, 0); 206 img_no_resize = EINA_TRUE;
206 evas_object_resize(sd->hit_rect, 0, 0);
207 return;
208 } 207 }
209 208
210 iw = ((double)iw) * sd->scale; 209 iw = ((double)iw) * sd->scale;
@@ -306,7 +305,10 @@ _image_sizing_eval(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Object *img)
306 } 305 }
307 } 306 }
308done: 307done:
309 evas_object_geometry_set(img, x, y, w, h); 308 if (img_no_resize)
309 evas_object_geometry_set(img, 0, 0, 0, 0);
310 else
311 evas_object_geometry_set(img, x, y, w, h);
310 312
311 evas_object_geometry_set(sd->hit_rect, x, y, w, h); 313 evas_object_geometry_set(sd->hit_rect, x, y, w, h);
312} 314}