From: yoz Date: Tue, 20 Dec 2011 11:45:53 +0000 (+0000) Subject: elementary: now you can align your icon X-Git-Tag: REL_F_I9500_20120323_1~17^2~1081 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=474d287df4d699f474df513eeccd88ca7b7d3993;p=framework%2Fuifw%2Felementary.git elementary: now you can align your icon git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@66387 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/els_icon.c b/src/lib/els_icon.c index 73f5584..ade438e 100644 --- a/src/lib/els_icon.c +++ b/src/lib/els_icon.c @@ -536,6 +536,8 @@ _smart_reconfigure(Smart_Data *sd) else { int iw = 0, ih = 0; + double alignh = 0.5, alignv = 0.5; + Evas_Object *parent; evas_object_image_size_get(sd->obj, &iw, &ih); @@ -575,8 +577,11 @@ _smart_reconfigure(Smart_Data *sd) if (w < iw) w = iw; if (h < ih) h = ih; } - x = sd->x + ((sd->w - w) / 2); - y = sd->y + ((sd->h - h) / 2); + parent = elm_widget_parent_widget_get(sd->obj); + if (parent) + evas_object_size_hint_align_get(parent, &alignh, &alignv); + x = sd->x + ((sd->w - w) * alignh); + y = sd->y + ((sd->h - h) * alignv); evas_object_move(sd->obj, x, y); evas_object_image_fill_set(sd->obj, 0, 0, w, h); evas_object_resize(sd->obj, w, h);