Page MenuHomePhabricator

Open, TODOPublic


class Efl.Ui.Table_Static @beta

Related Objects

YOhoho created this task.Sep 5 2019, 4:54 AM
YOhoho triaged this task as TODO priority.
YOhoho added a comment.Sep 5 2019, 4:58 AM

There is no declared members. it can be stable.

What's the purpose of this class? It has no documentation :/

YOhoho added a comment.Sep 5 2019, 7:36 PM

layout_update logic is same to elm_grid(legacy)

I am not familiar with elm_grid. Can you tell me what is the difference between Efl.Ui.Table and Efl.Ui.Table_Static?

YOhoho added a comment.Sep 9 2019, 4:10 AM

Efl.Ui.Table_Static use column and row as percentage. the default are (100, 100). for example,

Ooohhhhh.... I think I get it. In Efl.Ui.Table_Static the number of rows and columns is fixed to 100.
In this way you can position items using percentages and you do not have to worry about the real number of rows and columns.
Is this correct?

YOhoho added a comment.Sep 9 2019, 9:19 PM

The number of rows and columns can be changed by efl_pack_table_size_set.

efl_pack_table_size_set(table, 30, 30);
efl_pack_table(table, item, 0, 0, 15, 15);

In this case, item width will be (table width) * (15 / 30).

The more I look at this class the less I understand it.
It only needs to set its size to 100x100 cells in the constructor (which it already does) and then coords and sizes can be interpreted as percentages. This is fine.

But if you change the table size, what is the difference with the normal Efl.Ui.Table?

Put it in a different way, if I create a Efl.Ui.Table and set its size to 100x100 cells, what is the difference with Efl.Ui.Table_Static?

Also, I do not understand the check in ./src/lib/elementary/efl_ui_table_static.c:46 since that is enforced in the constructor.

YOhoho added a comment.EditedSep 11 2019, 2:31 AM

Efl.Ui.Table_Static has cells of same size divided by table size. the cells always take space even if it is empty. and its children hint property is ignored. They always fill the occupied cell space.

Efl.Ui.Table calculate cell size based on hint property of children occupying that cell. It doesn't take any space of empty cell. you can check that elementary_test -to 'efl.ui.table (linear api)' and click item 2.

zmike added a comment.Sep 11 2019, 8:14 AM

I'm confused as to why this would ever be needed. Do you have a sample case? I think this would help us with determining documentation...

zmike moved this task from Backlog to Evaluating on the efl: api board.Sep 16 2019, 7:17 AM
zmike added a comment.Sep 23 2019, 7:19 PM

Still waiting on this.

Hmm,, I think Table_Static can be replaced with RelativeLayout. for example,

efl_pack_table(table_static, btn1,  0,  0, 50, 50);
efl_pack_table(table_static, btn2,  50,  50, 100, 100);


efl_ui_relative_layout_relation_right_set(relative_layout, btn1, relative_layout, 0.5);
efl_ui_relative_layout_relation_bottom_set(relative_layout, btn1, relative_layout, 0.5);

efl_ui_relative_layout_relation_left_set(relative_layout, btn2, relative_layout, 0.5);
efl_ui_relative_layout_relation_top_set(relative_layout, btn2, relative_layout, 0.5);

Both codes produce same result to position buttons.
I'd like to keep @beta or remove this class.

Lets just keep beta for now, we still can remove it later on :)