2016-06-08 04:40:50 -07:00
|
|
|
#define EFL_GFX_SIZE_HINT_PROTECTED
|
|
|
|
|
2016-04-11 22:10:05 -07:00
|
|
|
#include "efl_ui_box_private.h"
|
|
|
|
|
|
|
|
// FIXME: handle RTL? just invert the horizontal order?
|
|
|
|
|
|
|
|
typedef struct _Item_Calc Item_Calc;
|
|
|
|
|
|
|
|
struct _Item_Calc
|
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
EINA_INLIST;
|
|
|
|
|
2016-04-11 22:10:05 -07:00
|
|
|
Evas_Object *obj;
|
|
|
|
double weight[2];
|
|
|
|
double align[2];
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
double space[2];
|
|
|
|
double comp_factor;
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
Eina_Bool fill[2];
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
Eina_Size2D max, min, aspect;
|
2016-04-11 22:10:05 -07:00
|
|
|
int pad[4];
|
2017-08-16 17:53:30 -07:00
|
|
|
Efl_Gfx_Size_Hint_Aspect aspect_type;
|
2016-04-11 22:10:05 -07:00
|
|
|
int id;
|
|
|
|
};
|
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
static int
|
|
|
|
weight_sort_cb(const void *l1, const void *l2)
|
|
|
|
{
|
|
|
|
Item_Calc *it1, *it2;
|
|
|
|
|
|
|
|
it1 = EINA_INLIST_CONTAINER_GET(l1, Item_Calc);
|
|
|
|
it2 = EINA_INLIST_CONTAINER_GET(l2, Item_Calc);
|
|
|
|
|
|
|
|
return it2->comp_factor <= it1->comp_factor ? -1 : 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
_min_max_calc(Item_Calc *item, int *cw, int *ch, Eina_Bool aspect_check)
|
|
|
|
{
|
|
|
|
int w = *cw, h = *ch;
|
|
|
|
|
|
|
|
if (aspect_check)
|
|
|
|
{
|
|
|
|
w = h * item->aspect.w / item->aspect.h;
|
|
|
|
if (w > *cw)
|
|
|
|
{
|
|
|
|
w = *cw;
|
|
|
|
h = w * item->aspect.h / item->aspect.w;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (w > item->max.w)
|
|
|
|
{
|
|
|
|
w = item->max.w;
|
|
|
|
if (aspect_check) h = w * item->aspect.h / item->aspect.w;
|
|
|
|
}
|
|
|
|
if (h > item->max.h)
|
|
|
|
{
|
|
|
|
h = item->max.h;
|
|
|
|
if (aspect_check) w = h * item->aspect.w / item->aspect.h;
|
|
|
|
}
|
|
|
|
if (w < item->min.w)
|
|
|
|
{
|
|
|
|
w = item->min.w;
|
|
|
|
if (aspect_check) h = w * item->aspect.h / item->aspect.w;
|
|
|
|
}
|
|
|
|
if (h < item->min.h)
|
|
|
|
{
|
|
|
|
h = item->min.h;
|
|
|
|
if (aspect_check) w = h * item->aspect.w / item->aspect.h;
|
|
|
|
}
|
|
|
|
*cw = w;
|
|
|
|
*ch = h;
|
|
|
|
}
|
|
|
|
|
2016-04-11 22:10:05 -07:00
|
|
|
void
|
Efl.Ui.Box: Implement way to override layout function
So, since we don't have function pointers, all the solutions
to reimplementing the layout function are quite convoluted:
1. use events
2. reimplement layout func
3. use an extra object
4. use a generic class (non instanciated)
Promises don't apply here (layout will run multiple times).
Problems:
1. Multiple event callbacks will be called, resulting in
potential performance impact, extra events, etc...
Also, there is no way to define standard implementations
that would be provided by the framework.
2. Reimplementation of a function requires extra EO work
(create an EO class, etc...), doesn't allow on-the-fly
change of the layout method.
3. Probably the best solution is to have an object implementing
the layout. But this means creating an extra object along
with the container.
4. To avoid the extra object, use a class, and reimplement
a @class function. This unfortunately requires extra
EO work.
Solution 4. has been selected, but it's not very nice...
2016-04-12 00:20:54 -07:00
|
|
|
_efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd)
|
2016-04-11 22:10:05 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Efl_Ui_Box_Data *pd = efl_data_scope_get(ui_box, EFL_UI_BOX_CLASS);
|
2016-04-11 22:10:05 -07:00
|
|
|
Evas_Object_Box_Option *opt;
|
|
|
|
Evas_Object *o;
|
|
|
|
Eina_List *li;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
Eina_Inlist *inlist = NULL;
|
2016-04-11 22:10:05 -07:00
|
|
|
int wantw = 0, wanth = 0; // requested size
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
Eina_Rect boxs;
|
2016-04-11 22:10:05 -07:00
|
|
|
Item_Calc *items, *item;
|
2017-08-09 06:36:29 -07:00
|
|
|
Eina_Bool horiz = efl_ui_dir_is_horizontal(pd->dir, EINA_FALSE);
|
2016-04-11 22:10:05 -07:00
|
|
|
int id = 0, count, boxl = 0, boxr = 0, boxt = 0, boxb = 0;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
int length, want, pad;
|
2019-02-13 05:39:20 -08:00
|
|
|
double cur_pos, weight[2] = { 0, 0 }, scale, mmin = 0;
|
2016-04-11 22:10:05 -07:00
|
|
|
double box_align[2];
|
2016-04-15 01:06:14 -07:00
|
|
|
Eina_Bool box_fill[2] = { EINA_FALSE, EINA_FALSE };
|
2016-04-11 22:10:05 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
boxs = efl_gfx_entity_geometry_get(ui_box);
|
2016-06-08 04:40:50 -07:00
|
|
|
efl_gfx_size_hint_margin_get(ui_box, &boxl, &boxr, &boxt, &boxb);
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
scale = efl_gfx_entity_scale_get(ui_box);
|
2016-04-11 22:10:05 -07:00
|
|
|
|
|
|
|
// Box align: used if "item has max size and fill" or "no item has a weight"
|
2016-04-15 01:06:14 -07:00
|
|
|
// Note: cells always expand on the orthogonal direction
|
|
|
|
box_align[0] = pd->align.h;
|
|
|
|
box_align[1] = pd->align.v;
|
|
|
|
if (box_align[0] < 0)
|
|
|
|
{
|
|
|
|
box_fill[0] = EINA_TRUE;
|
|
|
|
box_align[0] = 0.5;
|
|
|
|
}
|
|
|
|
if (box_align[1] < 0)
|
|
|
|
{
|
|
|
|
box_fill[1] = EINA_TRUE;
|
|
|
|
box_align[1] = 0.5;
|
|
|
|
}
|
2016-04-11 22:10:05 -07:00
|
|
|
|
|
|
|
count = eina_list_count(bd->children);
|
|
|
|
if (!count)
|
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
efl_gfx_size_hint_min_set(ui_box, EINA_SIZE2D(0, 0));
|
2016-04-11 22:10:05 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
items = alloca(count * sizeof(*items));
|
|
|
|
#ifdef DEBUG
|
|
|
|
memset(items, 0, count * sizeof(*items));
|
|
|
|
#endif
|
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
// box outer margin
|
|
|
|
boxs.w -= boxl + boxr;
|
|
|
|
boxs.h -= boxt + boxb;
|
|
|
|
boxs.x += boxl;
|
|
|
|
boxs.y += boxt;
|
|
|
|
|
2016-04-11 22:10:05 -07:00
|
|
|
// scan all items, get their properties, calculate total weight & min size
|
|
|
|
EINA_LIST_FOREACH(bd->children, li, opt)
|
|
|
|
{
|
|
|
|
item = &items[id];
|
|
|
|
o = item->obj = opt->obj;
|
|
|
|
|
2016-06-08 04:40:50 -07:00
|
|
|
efl_gfx_size_hint_weight_get(o, &item->weight[0], &item->weight[1]);
|
|
|
|
efl_gfx_size_hint_align_get(o, &item->align[0], &item->align[1]);
|
|
|
|
efl_gfx_size_hint_margin_get(o, &item->pad[0], &item->pad[1], &item->pad[2], &item->pad[3]);
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
efl_gfx_size_hint_fill_get(o, &item->fill[0], &item->fill[1]);
|
2017-09-17 22:07:56 -07:00
|
|
|
item->max = efl_gfx_size_hint_max_get(o);
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
item->min = efl_gfx_size_hint_combined_min_get(o);
|
2017-09-18 00:44:42 -07:00
|
|
|
efl_gfx_size_hint_aspect_get(o, &item->aspect_type, &item->aspect);
|
2017-08-16 17:53:30 -07:00
|
|
|
|
2019-02-13 05:39:20 -08:00
|
|
|
if (horiz && (box_fill[0] || pd->homogeneous)) item->weight[0] = 1;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
else if (item->weight[0] < 0) item->weight[0] = 0;
|
2019-02-13 05:39:20 -08:00
|
|
|
if (!horiz && (box_fill[1] || pd->homogeneous)) item->weight[1] = 1;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
else if (item->weight[1] < 0) item->weight[1] = 0;
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
|
|
|
|
if (EINA_DBL_EQ(item->align[0], -1))
|
|
|
|
{
|
|
|
|
item->align[0] = 0.5;
|
|
|
|
item->fill[0] = EINA_TRUE;
|
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
else if (item->align[0] < 0) item->align[0] = 0;
|
|
|
|
else if (item->align[0] > 1) item->align[0] = 1;
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
if (EINA_DBL_EQ(item->align[1], -1))
|
|
|
|
{
|
|
|
|
item->align[1] = 0.5;
|
|
|
|
item->fill[1] = EINA_TRUE;
|
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
else if (item->align[1] < 0) item->align[1] = 0;
|
|
|
|
else if (item->align[1] > 1) item->align[1] = 1;
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if (item->min.w < 0) item->min.w = 0;
|
|
|
|
if (item->min.h < 0) item->min.h = 0;
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
|
|
|
|
if (item->max.w < 0) item->max.w = INT_MAX;
|
|
|
|
if (item->max.h < 0) item->max.h = INT_MAX;
|
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
weight[0] += item->weight[0];
|
|
|
|
weight[1] += item->weight[1];
|
2017-08-16 17:53:30 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if ((item->aspect.w <= 0) || (item->aspect.h <= 0))
|
2017-08-16 17:53:30 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if ((item->aspect.w <= 0) ^ (item->aspect.h <= 0))
|
2017-08-16 17:53:30 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
ERR("Invalid aspect parameter for obj: %p", item->obj);
|
|
|
|
item->aspect.w = item->aspect.h = 0;
|
|
|
|
item->aspect_type = EFL_GFX_SIZE_HINT_ASPECT_NONE;
|
2017-08-16 17:53:30 -07:00
|
|
|
}
|
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
_min_max_calc(item, &item->min.w, &item->min.h, EINA_TRUE);
|
|
|
|
}
|
2016-04-11 22:10:05 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
item->space[0] = item->min.w + item->pad[0] + item->pad[1];
|
|
|
|
item->space[1] = item->min.h + item->pad[2] + item->pad[3];
|
2016-04-11 22:10:05 -07:00
|
|
|
|
|
|
|
if (horiz)
|
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if (item->space[1] > wanth)
|
|
|
|
wanth = item->space[1];
|
2019-02-13 05:39:20 -08:00
|
|
|
if (pd->homogeneous)
|
|
|
|
{
|
|
|
|
if (item->space[0] > mmin)
|
|
|
|
mmin = item->space[0];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wantw += item->space[0];
|
|
|
|
}
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if (item->space[0] > wantw)
|
|
|
|
wantw = item->space[0];
|
2019-02-13 05:39:20 -08:00
|
|
|
if (pd->homogeneous)
|
|
|
|
{
|
|
|
|
if (item->space[1] > mmin)
|
|
|
|
mmin = item->space[1];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wanth += item->space[1];
|
|
|
|
}
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
item->id = id++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// total space & available space
|
|
|
|
if (horiz)
|
|
|
|
{
|
2019-02-13 05:39:20 -08:00
|
|
|
if (pd->homogeneous)
|
|
|
|
wantw = mmin * count;
|
2016-04-11 22:10:05 -07:00
|
|
|
want = wantw;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
length = boxs.w;
|
2016-04-11 22:10:05 -07:00
|
|
|
pad = pd->pad.scalable ? (pd->pad.h * scale) : pd->pad.h;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if (boxs.h < wanth)
|
|
|
|
boxs.h = wanth;
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-02-13 05:39:20 -08:00
|
|
|
if (pd->homogeneous)
|
|
|
|
wanth = mmin * count;
|
2016-04-11 22:10:05 -07:00
|
|
|
want = wanth;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
length = boxs.h;
|
2016-04-11 22:10:05 -07:00
|
|
|
pad = pd->pad.scalable ? (pd->pad.v * scale) : pd->pad.v;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if (boxs.w < wantw)
|
|
|
|
boxs.w = wantw;
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// padding can not be squeezed (note: could make it an option)
|
|
|
|
length -= pad * (count - 1);
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
cur_pos = horiz ? boxs.x : boxs.y;
|
2016-04-11 22:10:05 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
// calculate weight length
|
2019-02-13 05:39:20 -08:00
|
|
|
if (!pd->homogeneous && (length > want) && (weight[!horiz] > 0))
|
2016-04-11 22:10:05 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
int orig_length = length;
|
|
|
|
double orig_weight = weight[!horiz];
|
2016-04-11 22:10:05 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
for (id = 0; id < count; id++)
|
2016-04-11 22:10:05 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
double denom;
|
|
|
|
item = &items[id];
|
2016-04-11 22:10:05 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
denom = (item->weight[!horiz] * orig_length) -
|
|
|
|
(orig_weight * item->space[!horiz]);
|
|
|
|
if (denom > 0)
|
2016-04-11 22:10:05 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
item->comp_factor = (item->weight[!horiz] * orig_length) / denom;
|
|
|
|
inlist = eina_inlist_sorted_insert(inlist, EINA_INLIST_GET(item),
|
|
|
|
weight_sort_cb);
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
else
|
2017-08-16 17:53:30 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
length -= item->space[!horiz];
|
|
|
|
weight[!horiz] -= item->weight[!horiz];
|
2017-08-16 17:53:30 -07:00
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
}
|
2017-08-16 17:53:30 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
EINA_INLIST_FOREACH(inlist, item)
|
|
|
|
{
|
|
|
|
double weight_len;
|
|
|
|
|
|
|
|
weight_len = (length * item->weight[!horiz]) / weight[!horiz];
|
|
|
|
if (item->space[!horiz] < weight_len)
|
2016-04-11 22:10:05 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
item->space[!horiz] = weight_len;
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
else
|
2017-08-16 17:53:30 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
weight[!horiz] -= item->weight[!horiz];
|
|
|
|
length -= item->space[!horiz];
|
2017-08-16 17:53:30 -07:00
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
}
|
|
|
|
}
|
2017-08-16 17:53:30 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
// calculate item geometry
|
|
|
|
{
|
|
|
|
int x, y, w, h, sw, sh;
|
2017-08-16 17:53:30 -07:00
|
|
|
|
2019-02-13 05:39:20 -08:00
|
|
|
if (length > want)
|
|
|
|
{
|
|
|
|
if (pd->homogeneous)
|
|
|
|
mmin = (double)length / count;
|
|
|
|
else if (EINA_DBL_EQ(weight[!horiz], 0))
|
|
|
|
cur_pos += (length - want) * box_align[!horiz];
|
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
|
|
|
|
for (id = 0; id < count; id++)
|
2016-04-11 22:10:05 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
item = &items[id];
|
2019-02-13 05:39:20 -08:00
|
|
|
if (pd->homogeneous)
|
|
|
|
item->space[!horiz] = mmin;
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
item->space[horiz] = horiz ? boxs.h : boxs.w;
|
|
|
|
sw = item->space[0] - item->pad[0] - item->pad[1];
|
|
|
|
sh = item->space[1] - item->pad[2] - item->pad[3];
|
|
|
|
|
|
|
|
if ((item->weight[0] > 0) && item->fill[0])
|
|
|
|
w = sw;
|
2017-08-16 15:56:23 -07:00
|
|
|
else
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
w = 0;
|
2017-08-16 17:53:30 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if ((item->weight[1] > 0) && item->fill[1])
|
|
|
|
h = sh;
|
|
|
|
else
|
|
|
|
h = 0;
|
|
|
|
|
|
|
|
_min_max_calc(item, &w, &h, (item->aspect.w > 0) &&
|
|
|
|
(item->aspect.h > 0));
|
|
|
|
if (horiz)
|
2017-08-16 17:53:30 -07:00
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
x = cur_pos + 0.5;
|
|
|
|
y = boxs.y;
|
2017-08-16 17:53:30 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
x = boxs.x;
|
|
|
|
y = cur_pos + 0.5;
|
2017-08-16 17:53:30 -07:00
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
x += item->pad[0] + ((sw - w) * item->align[0]);
|
|
|
|
y += item->pad[2] + ((sh - h) * item->align[1]);
|
|
|
|
|
|
|
|
cur_pos += item->space[!horiz] + pad;
|
|
|
|
|
|
|
|
efl_gfx_entity_geometry_set(item->obj, EINA_RECT(x, y, w, h));
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
}
|
2016-04-11 22:10:05 -07:00
|
|
|
|
ui.box: refactor layout_update
Summary:
Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.
In order to resolve the hint priority conflict, this refactoring supports
following hint priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign
ref T5487
Specific unit test is D7463
Test Plan:
make check
elementary_test -to 'efl.ui.box'
Reviewers: jpeg, Jaehyun_Cho, zmike
Reviewed By: zmike
Subscribers: segfaultxavi, zmike, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T5487
Differential Revision: https://phab.enlightenment.org/D7750
2019-02-13 05:38:58 -08:00
|
|
|
if (horiz)
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_min_set(ui_box, EINA_SIZE2D(
|
|
|
|
wantw + boxl + boxr + pad * (count - 1),
|
|
|
|
wanth + boxt + boxb));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
efl_gfx_size_hint_min_set(ui_box, EINA_SIZE2D(
|
|
|
|
wantw + boxl + boxr,
|
|
|
|
wanth + pad * (count - 1) + boxt + boxb));
|
2016-04-11 22:10:05 -07:00
|
|
|
}
|
|
|
|
}
|