forked from enlightenment/efl
efl.ui.box: Switch to Efl.Ui.Dir (EO)
This makes the default box vertical, just like in legacy. The flow box is horizontal by default. Ref T5870
This commit is contained in:
parent
d4b4ee867b
commit
b1488b98de
|
@ -334,6 +334,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
|||
efl_ui_win_alpha_set(efl_added, 1));
|
||||
|
||||
box = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1, 1),
|
||||
efl_content_set(win, efl_added));
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
|||
efl_ui_win_autodel_set(efl_added, 1));
|
||||
|
||||
box = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN),
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
|
||||
efl_content_set(win, box);
|
||||
|
||||
|
@ -156,7 +156,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
|
|||
efl_content_set(efl_part(ly, "content"), gl);
|
||||
|
||||
box2 = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_RIGHT),
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_LTR),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
|
||||
efl_pack(box, efl_added));
|
||||
|
|
|
@ -183,6 +183,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
|
|||
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win));
|
||||
|
||||
box = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
|
||||
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
|
||||
efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, GRID_SIZE, 1));
|
||||
|
||||
|
|
|
@ -166,7 +166,8 @@ test_events(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
win = elm_win_util_standard_add("buttons", "Buttons");
|
||||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win, efl_orientation_set(efl_added, EFL_ORIENT_VERTICAL));
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
|
||||
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(bx, -1, -1);
|
||||
efl_content_set(win, bx);
|
||||
|
|
|
@ -330,14 +330,14 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
efl_ui_win_autodel_set(efl_added, 1));
|
||||
|
||||
box = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN),
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
|
||||
|
||||
efl_content_set(win, box);
|
||||
|
||||
{
|
||||
box2 = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_HORIZONTAL),
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, -1.0, 0.0));
|
||||
efl_pack(box, box2);
|
||||
|
@ -374,7 +374,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
|
||||
{
|
||||
box2 = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_HORIZONTAL),
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5),
|
||||
efl_pack_padding_set(efl_added, 5, 5, 1),
|
||||
|
@ -445,6 +445,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
efl_content_set(efl_part(split, "top"), flip);
|
||||
|
||||
box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
|
||||
efl_pack_align_set(efl_added, 0.5, 0.5));
|
||||
|
@ -460,6 +461,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
|
|||
efl_pack(box2, o);
|
||||
|
||||
o = box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
|
||||
efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
|
||||
efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
|
||||
efl_pack_align_set(efl_added, 0.5, 0.5));
|
||||
|
|
|
@ -811,7 +811,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
|
|||
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN),
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN),
|
||||
efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
|
||||
efl_content_set(win, efl_added));
|
||||
|
||||
|
|
|
@ -132,7 +132,8 @@ flow_check_cb(void *data, const Efl_Event *event)
|
|||
efl_pack_unpack_all(box);
|
||||
efl_del(box);
|
||||
|
||||
box = efl_add(chk ? EFL_UI_BOX_FLOW_CLASS : EFL_UI_BOX_CLASS, win);
|
||||
box = efl_add(chk ? EFL_UI_BOX_FLOW_CLASS : EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
|
||||
efl_content_set(parent, box);
|
||||
efl_key_wref_set(win, "box", box);
|
||||
|
||||
|
@ -145,7 +146,7 @@ horiz_check_cb(void *data, const Efl_Event *event)
|
|||
{
|
||||
Eina_Bool chk = elm_check_selected_get(event->object);
|
||||
Eo *box = efl_key_wref_get(data, "box");
|
||||
efl_orientation_set(box, chk ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL);
|
||||
efl_ui_direction_set(box, chk ? EFL_UI_DIR_HORIZONTAL : EFL_UI_DIR_VERTICAL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -221,9 +222,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
efl_gfx_size_set(win, 600, 400);
|
||||
|
||||
vbox = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
vbox = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
|
||||
efl_orientation_set(vbox, EFL_ORIENT_DOWN);
|
||||
efl_gfx_size_hint_weight_set(vbox, 1, 1);
|
||||
efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
|
||||
elm_win_resize_object_add(win, vbox);
|
||||
|
@ -237,14 +238,15 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
efl_pack(vbox, f);
|
||||
efl_gfx_visible_set(f, 1);
|
||||
|
||||
hbox = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
hbox = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
|
||||
elm_object_content_set(f, hbox);
|
||||
efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
|
||||
|
||||
|
||||
/* weights radio group */
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN));
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_gfx_size_hint_align_set(bx, 0, -1);
|
||||
efl_pack(hbox, bx);
|
||||
|
||||
|
@ -297,7 +299,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
|
||||
/* misc */
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN));
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_gfx_size_hint_align_set(bx, 0, -1);
|
||||
efl_gfx_size_hint_weight_set(bx, 0, 1);
|
||||
efl_pack(hbox, bx);
|
||||
|
@ -351,7 +353,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
|
||||
/* user min size setter */
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN));
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_gfx_size_hint_align_set(bx, 0, -1);
|
||||
efl_gfx_size_hint_weight_set(bx, 0, 1);
|
||||
efl_pack(hbox, bx);
|
||||
|
@ -377,7 +379,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
|
||||
/* inner box padding */
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN));
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_gfx_size_hint_align_set(bx, 0, -1);
|
||||
efl_gfx_size_hint_weight_set(bx, 0, 1);
|
||||
efl_pack(hbox, bx);
|
||||
|
@ -403,7 +405,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
|
||||
/* outer margin */
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN));
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_gfx_size_hint_align_set(bx, 0, -1);
|
||||
efl_gfx_size_hint_weight_set(bx, 0, 1);
|
||||
efl_pack(hbox, bx);
|
||||
|
@ -429,7 +431,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
|
||||
/* Box align */
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_orientation_set(efl_added, EFL_ORIENT_DOWN));
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_gfx_size_hint_align_set(bx, 0, -1);
|
||||
efl_gfx_size_hint_weight_set(bx, 1, 1);
|
||||
efl_pack(hbox, bx);
|
||||
|
@ -475,7 +477,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
|
|||
efl_pack(vbox, f);
|
||||
efl_gfx_visible_set(f, 1);
|
||||
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
|
||||
efl_key_wref_set(win, "box", bx);
|
||||
efl_pack_padding_set(bx, 10, 10, EINA_TRUE);
|
||||
efl_gfx_size_hint_align_set(bx, 0.5, 0.5);
|
||||
|
|
|
@ -177,9 +177,9 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
|
|||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
efl_gfx_size_set(win, 600, 400);
|
||||
|
||||
vbox = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
vbox = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
|
||||
efl_orientation_set(vbox, EFL_ORIENT_DOWN);
|
||||
efl_gfx_size_hint_weight_set(vbox, 1, 1);
|
||||
efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
|
||||
elm_win_resize_object_add(win, vbox);
|
||||
|
@ -197,7 +197,8 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
|
|||
efl_pack(vbox, f);
|
||||
efl_gfx_visible_set(f, 1);
|
||||
|
||||
hbox = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
hbox = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
|
||||
elm_object_content_set(f, hbox);
|
||||
efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
|
||||
|
||||
|
@ -502,9 +503,9 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
efl_gfx_size_set(win, 600, 400);
|
||||
|
||||
vbox = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
vbox = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||
efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
|
||||
efl_orientation_set(vbox, EFL_ORIENT_DOWN);
|
||||
efl_gfx_size_hint_weight_set(vbox, 1, 1);
|
||||
efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
|
||||
elm_win_resize_object_add(win, vbox);
|
||||
|
@ -523,7 +524,8 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
efl_pack(vbox, f);
|
||||
efl_gfx_visible_set(f, 1);
|
||||
|
||||
hbox = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
hbox = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
|
||||
elm_object_content_set(f, hbox);
|
||||
efl_pack_padding_set(hbox, 5, 0, EINA_TRUE);
|
||||
efl_gfx_visible_set(hbox, 1);
|
||||
|
|
|
@ -225,7 +225,8 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
|
|||
elm_win_resize_object_add(win, bg);
|
||||
evas_object_show(bg);
|
||||
|
||||
box = efl_add(EFL_UI_BOX_CLASS, win);
|
||||
box = efl_add(EFL_UI_BOX_CLASS, win,
|
||||
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
|
||||
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, box);
|
||||
|
||||
|
|
|
@ -232,7 +232,6 @@ _efl_ui_box_efl_object_constructor(Eo *obj, Efl_Ui_Box_Data *pd)
|
|||
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
|
||||
elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_FILLER);
|
||||
|
||||
pd->orient = EFL_ORIENT_RIGHT;
|
||||
pd->align.h = 0.5;
|
||||
pd->align.v = 0.5;
|
||||
|
||||
|
@ -532,29 +531,34 @@ _efl_ui_box_efl_container_content_iterate(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUS
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_box_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Orient dir)
|
||||
_efl_ui_box_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Ui_Dir dir)
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
case EFL_ORIENT_UP:
|
||||
case EFL_ORIENT_DOWN:
|
||||
pd->orient = EFL_ORIENT_DOWN;
|
||||
case EFL_UI_DIR_RTL:
|
||||
// FIXME: Should be inverted!
|
||||
case EFL_UI_DIR_HORIZONTAL:
|
||||
case EFL_UI_DIR_LTR:
|
||||
pd->dir = EFL_UI_DIR_HORIZONTAL;
|
||||
break;
|
||||
|
||||
case EFL_ORIENT_RIGHT:
|
||||
case EFL_ORIENT_LEFT:
|
||||
case EFL_UI_DIR_UP:
|
||||
// FIXME: Should be inverted!
|
||||
case EFL_UI_DIR_DOWN:
|
||||
case EFL_UI_DIR_VERTICAL:
|
||||
case EFL_UI_DIR_DEFAULT:
|
||||
default:
|
||||
pd->orient = EFL_ORIENT_RIGHT;
|
||||
pd->dir = EFL_UI_DIR_VERTICAL;
|
||||
break;
|
||||
}
|
||||
|
||||
efl_pack_layout_request(obj);
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Orient
|
||||
_efl_ui_box_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd)
|
||||
EOLIAN static Efl_Ui_Dir
|
||||
_efl_ui_box_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd)
|
||||
{
|
||||
return pd->orient;
|
||||
return pd->dir;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
|
|
@ -1,7 +1,20 @@
|
|||
class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout,
|
||||
Efl.Orientation)
|
||||
Efl.Ui.Direction)
|
||||
{
|
||||
[[Efl UI box class]]
|
||||
[[The box widget.
|
||||
|
||||
A box arranges objects in a linear fashion, governed by a layout function
|
||||
that defines the details of this arrangement.
|
||||
|
||||
By default, the box will use an internal function to set the layout to
|
||||
a single row, either vertical or horizontal. This layout is affected
|
||||
by a number of parameters. The values given by @Efl.Pack.pack_padding.set
|
||||
and @Efl.Pack.pack_align.set and the hints set to each object in the box.
|
||||
|
||||
FIXME:
|
||||
THIS CLASS NEEDS GOOD UP TO DATE DOCUMENTATION. LEGACY BOX AND UI BOX
|
||||
BEHAVE SLIGHTLY DIFFERENTLY AND USE VASTLY DIFFERENT APIS.
|
||||
]]
|
||||
implements {
|
||||
Efl.Object.constructor;
|
||||
Efl.Canvas.Group.group_calculate;
|
||||
|
@ -11,7 +24,7 @@ class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout,
|
|||
Elm.Widget.focus_next;
|
||||
Efl.Container.content_iterate;
|
||||
Efl.Container.content_count;
|
||||
Efl.Orientation.orientation { get; set; }
|
||||
Efl.Ui.Direction.direction { get; set; }
|
||||
Efl.Pack.pack_clear;
|
||||
Efl.Pack.unpack_all;
|
||||
Efl.Pack.unpack;
|
||||
|
|
|
@ -48,7 +48,8 @@ _efl_ui_box_flow_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Flow_Data *pd
|
|||
homo = pd->homogenous;
|
||||
maxsize = pd->max_size;
|
||||
|
||||
if (_horiz(efl_orientation_get(obj)))
|
||||
// This makes it horizontal by default, as opposed to the standard box.
|
||||
if (efl_ui_dir_is_horizontal(efl_ui_direction_get(obj), EINA_TRUE))
|
||||
{
|
||||
if (homo)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,8 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd)
|
|||
int wantw = 0, wanth = 0; // requested size
|
||||
int boxx, boxy, boxw, boxh;
|
||||
Item_Calc *items, *item;
|
||||
Eina_Bool horiz = _horiz(pd->orient), zeroweight = EINA_FALSE;
|
||||
Eina_Bool horiz = efl_ui_dir_is_horizontal(pd->dir, EINA_FALSE);
|
||||
Eina_Bool zeroweight = EINA_FALSE;
|
||||
int id = 0, count, boxl = 0, boxr = 0, boxt = 0, boxb = 0;
|
||||
int length, want, pad, extra = 0, rounding = 0;
|
||||
double cur_pos = 0, weight[2] = { 0, 0 }, scale;
|
||||
|
|
|
@ -21,7 +21,7 @@ typedef struct _Box_Item_Iterator Box_Item_Iterator;
|
|||
|
||||
struct _Efl_Ui_Box_Data
|
||||
{
|
||||
Efl_Orient orient;
|
||||
Efl_Ui_Dir dir;
|
||||
Eina_Bool homogeneous : 1;
|
||||
Eina_Bool delete_me : 1;
|
||||
Eina_Bool recalc : 1;
|
||||
|
@ -44,10 +44,4 @@ struct _Box_Item_Iterator
|
|||
Efl_Ui_Box *object;
|
||||
};
|
||||
|
||||
static inline Eina_Bool
|
||||
_horiz(Efl_Orient dir)
|
||||
{
|
||||
return dir % 180 == EFL_ORIENT_RIGHT;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -641,6 +641,21 @@ const Elm_Layout_Part_Alias_Description *elm_layout_text_aliases_get(const Eo *o
|
|||
#define ELM_LAYOUT_SIZING_EVAL_OPS(_pfx) \
|
||||
EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _##_pfx##_elm_layout_sizing_eval)
|
||||
|
||||
static inline Eina_Bool
|
||||
efl_ui_dir_is_horizontal(Efl_Ui_Dir dir, Eina_Bool def_val)
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
case EFL_UI_DIR_DEFAULT: return !!def_val;
|
||||
case EFL_UI_DIR_HORIZONTAL: return EINA_TRUE;
|
||||
case EFL_UI_DIR_VERTICAL: return EINA_FALSE;
|
||||
case EFL_UI_DIR_LTR: return EINA_TRUE;
|
||||
case EFL_UI_DIR_RTL: return EINA_TRUE;
|
||||
case EFL_UI_DIR_DOWN: return EINA_FALSE;
|
||||
case EFL_UI_DIR_UP: return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#undef EAPI
|
||||
#define EAPI
|
||||
|
||||
|
|
Loading…
Reference in New Issue