forked from enlightenment/efl
parent
517f5c3d52
commit
322b55133d
|
@ -77,7 +77,8 @@ test_box_vert2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
||||||
|
|
||||||
bx = elm_box_add(win);
|
bx = elm_box_add(win);
|
||||||
elm_win_resize_object_add(win, bx);
|
elm_win_resize_object_add(win, bx);
|
||||||
evas_object_size_hint_weight_set(bx, 0.0, 0.0);
|
elm_box_padding_set(bx, 10, 10);
|
||||||
|
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_show(bx);
|
evas_object_show(bx);
|
||||||
|
|
||||||
bt = elm_button_add(win);
|
bt = elm_button_add(win);
|
||||||
|
@ -188,8 +189,8 @@ _test_box_transition_change(void *data)
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
next_layout = eina_list_data_get(tdata->transitions);
|
next_layout = eina_list_data_get(tdata->transitions);
|
||||||
layout_data = elm_box_transition_new(2.0, tdata->last_layout,
|
layout_data = elm_box_transition_new(2.0, tdata->last_layout,
|
||||||
NULL, NULL, next_layout, NULL, NULL,
|
NULL, NULL, next_layout, NULL, NULL,
|
||||||
_test_box_transition_change, tdata);
|
_test_box_transition_change, tdata);
|
||||||
elm_box_layout_set(tdata->box, elm_box_layout_transition, layout_data, elm_box_transition_free);
|
elm_box_layout_set(tdata->box, elm_box_layout_transition, layout_data, elm_box_transition_free);
|
||||||
tdata->last_layout = next_layout;
|
tdata->last_layout = next_layout;
|
||||||
|
|
||||||
|
@ -200,8 +201,9 @@ static void
|
||||||
_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
Transitions_Data *tdata = data;
|
Transitions_Data *tdata = data;
|
||||||
|
if (!data) return;
|
||||||
elm_box_layout_set(tdata->box, evas_object_box_layout_horizontal, NULL, NULL);
|
elm_box_layout_set(tdata->box, evas_object_box_layout_horizontal, NULL, NULL);
|
||||||
free(data);
|
free(tdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -7,6 +7,7 @@ _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horiz
|
||||||
Evas_Coord minw, minh, mnw, mnh;
|
Evas_Coord minw, minh, mnw, mnh;
|
||||||
const Eina_List *l;
|
const Eina_List *l;
|
||||||
Evas_Object_Box_Option *opt;
|
Evas_Object_Box_Option *opt;
|
||||||
|
int c;
|
||||||
|
|
||||||
/* FIXME: need to calc max */
|
/* FIXME: need to calc max */
|
||||||
minw = 0;
|
minw = 0;
|
||||||
|
@ -41,6 +42,12 @@ _smart_extents_calculate(Evas_Object *box, Evas_Object_Box_Data *priv, int horiz
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c = eina_list_count(priv->children) - 1;
|
||||||
|
if (c > 0)
|
||||||
|
{
|
||||||
|
if (horizontal) minw += priv->pad.h * c;
|
||||||
|
else minh += priv->pad.v * c;
|
||||||
|
}
|
||||||
evas_object_size_hint_min_set(box, minw, minh);
|
evas_object_size_hint_min_set(box, minw, minh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +69,7 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
|
||||||
evas_object_size_hint_min_get(o, &minw, &minh);
|
evas_object_size_hint_min_get(o, &minw, &minh);
|
||||||
evas_object_size_hint_align_get(o, &ax, &ay);
|
evas_object_size_hint_align_get(o, &ax, &ay);
|
||||||
count = eina_list_count(priv->children);
|
count = eina_list_count(priv->children);
|
||||||
|
|
||||||
if (w < minw)
|
if (w < minw)
|
||||||
{
|
{
|
||||||
x = x + ((w - minw) * (1.0 - ax));
|
x = x + ((w - minw) * (1.0 - ax));
|
||||||
|
@ -153,6 +161,7 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
|
||||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||||
evas_object_resize(obj, ow, oh);
|
evas_object_resize(obj, ow, oh);
|
||||||
xx += ww;
|
xx += ww;
|
||||||
|
xx += priv->pad.h;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -185,6 +194,7 @@ _els_box_layout(Evas_Object *o, Evas_Object_Box_Data *priv, int horizontal, int
|
||||||
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
yy + (Evas_Coord)(((double)(hh - oh)) * ay));
|
||||||
evas_object_resize(obj, ow, oh);
|
evas_object_resize(obj, ow, oh);
|
||||||
yy += hh;
|
yy += hh;
|
||||||
|
yy += priv->pad.v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue