forked from enlightenment/efl
elementary: now you can align your icon
SVN revision: 66387
This commit is contained in:
parent
b1f771a890
commit
d3b9a3ac50
|
@ -536,6 +536,8 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int iw = 0, ih = 0;
|
int iw = 0, ih = 0;
|
||||||
|
double alignh = 0.5, alignv = 0.5;
|
||||||
|
Evas_Object *parent;
|
||||||
|
|
||||||
evas_object_image_size_get(sd->obj, &iw, &ih);
|
evas_object_image_size_get(sd->obj, &iw, &ih);
|
||||||
|
|
||||||
|
@ -575,8 +577,11 @@ _smart_reconfigure(Smart_Data *sd)
|
||||||
if (w < iw) w = iw;
|
if (w < iw) w = iw;
|
||||||
if (h < ih) h = ih;
|
if (h < ih) h = ih;
|
||||||
}
|
}
|
||||||
x = sd->x + ((sd->w - w) / 2);
|
parent = elm_widget_parent_widget_get(sd->obj);
|
||||||
y = sd->y + ((sd->h - h) / 2);
|
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_move(sd->obj, x, y);
|
||||||
evas_object_image_fill_set(sd->obj, 0, 0, w, h);
|
evas_object_image_fill_set(sd->obj, 0, 0, w, h);
|
||||||
evas_object_resize(sd->obj, w, h);
|
evas_object_resize(sd->obj, w, h);
|
||||||
|
|
Loading…
Reference in New Issue