Commit Graph

10 Commits

Author SHA1 Message Date
Mike Blumenkrantz 3ba31a1f5c efl_ui/table: optimize position_set operations with tables
if a table is moved and no other changes are made to the table or its children,
e.g., if the table is scrolled, then there is no need to loop over the table's
items repeatedly in order to accurately calculate all the item geometries
and positions.

instead, simply apply an offset from the last table calc position to each child
item and handle the position changes more transparently

this yields roughly a 12% perf improvement to the 'efl.ui.scroller simple2' test
and brings rendering up to nearly 60fps

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9346
2019-07-19 10:55:03 -07:00
Mike Blumenkrantz 8e3877cc23 efl_ui/table: avoid exploding stack with lots of subobjects
using alloca like this without any limits is dangerous, so switch to
malloc here in such cases

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9344
2019-07-19 10:54:59 -07:00
Mike Blumenkrantz 499ee62980 efl_ui/table: emit EFL_PACK_EVENT_LAYOUT_UPDATED on layout updates
this should be emitted.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9343
2019-07-17 10:54:51 -07:00
Yeongjong Lee 3e49501043 ui.table: remove leagcy evas_table from Efl.Ui.Table
Remove evas_table.
This expect to improve performance by removing internal function call related
evas_table.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8615
2019-04-21 12:13:13 +02:00
Yeongjong Lee e361b45ce1 efl_ui_table_layout: calculate cell size with colspan, rowspan property
We should consider occupied cells by colspan, rowspan property.

ref T7753

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8484
2019-03-30 12:38:27 +01:00
Yeongjong Lee 0b7cd8d88e ui.box, ui.table: respect user min
Use restricted_min_set instead of min_set in layout_update.
min_set is set by public API(user side). if it is changed by internal function,
user will get unexpected value later. please check added test case.

Note that this reverts commit e013480e7a. instead,
this patch provides better solution of the issue refered in e013480e7.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8214
2019-03-07 09:59:05 -08:00
Yeongjong Lee b857fa7420 ui.table: fix infinite loop when initializing calc data
infinite loop if first cell is empty.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8170
2019-03-07 09:58:58 -08:00
Yeongjong Lee e013480e7a ui.box, ui.table: respect parent hint size min
Summary:
This patch fixes issue that parent hint size min is ignored when it is greater
than children hint size min sum.

Thanks to segfaultxavi for reporting this.

Test Plan:
1. make check
2. 'hello-gui' or 'texteditor' example in examples.git

Reviewers: segfaultxavi, zmike

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8098
2019-03-05 09:31:19 +01:00
Yeongjong Lee 138fa4eeaa ui.table: implement homogeneous mode
Summary:
Homogeneous mode means children are of the same weight and of the same min size
which is determined by maximum min size of cells.

Depends on D7841

Reviewers: Jaehyun_Cho, jpeg, zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7892
2019-02-27 14:45:32 -05:00
Yeongjong Lee 5572000f1a efl_ui_table: refactor layout_update
Summary:
There are three reasons to refactor layout_update of Efl.Ui.Table.

=== 1. Inconsistency of hint behavior. ===

Some hint property is often not respected. for example, hint_min is ignored in
Table when it is used with hint_max even if hint_weight is 0. hint_aspect is
always ignored in Table.
The ambiguous behavior make it hard to layout widgets in container. of course,
we documented 'it's just a hint that should be used whenever appropriate.' but i
don't think it means that 'hint API is sometimes respected and we also don't
know when that API is respected.'. at least there is rule for consistent
behavior and we should be able to explain why a widget is located here and
why some hint property is ignored.

So, i'll suggest priority of hint property. this refactoring support following
priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign

ref T5487
Please check with unit test D7840

=== 2. To Enhance usability. ===

Efl.Ui.Table is using homogeneous mode of evas_table which have same columns,
rows size. but i think a table can generally change columns, rows size and
we can provide homogeneous mode option.(D7892)

In this patch
 - table columns(rows) min size is decided by maximum size among its cells
width(height) min size.
 - table columns(rows) weight is decided by maximum weight among its cells
horizontal(vertical) weight.

Also, pack_align is implemented. it is used if no item has a weight.

=== 3. To remove internal evas_table. ===

This is low priority work. however, i guess is is necessary for lightweight
container widget. there are two size_hint callback to adjust table size and
efl_canvas_group_calculate is called twice when it is resized.
This patch is first step to remove internal evas_table.

Test Plan:
make check
elementary_test -to 'efl.ui.table'

Reviewers: jpeg, Jaehyun_Cho, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T5487

Differential Revision: https://phab.enlightenment.org/D7841
2019-02-27 14:45:27 -05:00