2016-04-13 19:12:44 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2016-04-19 01:43:28 -07:00
|
|
|
|
|
|
|
#define EFL_PACK_LAYOUT_PROTECTED
|
2019-03-07 07:39:06 -08:00
|
|
|
#include <Efl_Ui.h>
|
2016-04-13 19:12:44 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
|
2017-04-16 21:41:29 -07:00
|
|
|
static void _custom_layout_update(Eo *pack, void *_pd EINA_UNUSED);
|
|
|
|
|
2016-04-13 19:12:44 -07:00
|
|
|
static Evas_Object *objects[7] = {};
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NONE,
|
|
|
|
NONE_BUT_FILL,
|
|
|
|
EQUAL,
|
|
|
|
ONE,
|
2016-04-18 04:17:24 -07:00
|
|
|
TWO,
|
|
|
|
CUSTOM
|
2016-04-13 19:12:44 -07:00
|
|
|
} Weight_Mode;
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2019-05-29 11:06:25 -07:00
|
|
|
weights_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
2016-04-13 19:12:44 -07:00
|
|
|
{
|
2017-04-16 21:41:29 -07:00
|
|
|
EFL_OPS_DEFINE(custom_layout_ops,
|
|
|
|
EFL_OBJECT_OP_FUNC(efl_pack_layout_update, _custom_layout_update));
|
|
|
|
|
2019-05-29 11:06:25 -07:00
|
|
|
Weight_Mode mode = elm_radio_state_value_get(obj);
|
2017-12-18 21:13:58 -08:00
|
|
|
Eo *table = data;
|
2016-04-18 04:17:24 -07:00
|
|
|
|
|
|
|
if (mode != CUSTOM)
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_object_override(table, NULL);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case NONE:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(table, 0.5, 0.5);
|
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 11:45:27 -08:00
|
|
|
for (int i = 1; i < 7; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
2016-04-13 19:12:44 -07:00
|
|
|
break;
|
|
|
|
case NONE_BUT_FILL:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_fill_set(table, EINA_TRUE, EINA_TRUE);
|
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 11:45:27 -08:00
|
|
|
for (int i = 1; i < 7; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
2016-04-13 19:12:44 -07:00
|
|
|
break;
|
|
|
|
case EQUAL:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(table, 0.5, 0.5);
|
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 11:45:27 -08:00
|
|
|
for (int i = 1; i < 7; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 1, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
break;
|
|
|
|
case ONE:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(table, 0.5, 0.5);
|
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 11:45:27 -08:00
|
|
|
for (int i = 1; i < 7; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
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 11:45:27 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[2], 1, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
break;
|
|
|
|
case TWO:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(table, 0.5, 0.5);
|
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 11:45:27 -08:00
|
|
|
for (int i = 1; i < 7; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[i], 0, 0);
|
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 11:45:27 -08:00
|
|
|
efl_gfx_hint_weight_set(objects[2], 1, 1);
|
|
|
|
efl_gfx_hint_weight_set(objects[3], 1, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
break;
|
2016-04-18 04:17:24 -07:00
|
|
|
case CUSTOM:
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_object_override(table, &custom_layout_ops);
|
2016-04-18 04:17:24 -07:00
|
|
|
break;
|
2016-04-13 19:12:44 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
2016-04-13 19:12:44 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2016-04-13 19:12:44 -07:00
|
|
|
for (int i = 0; i < 6; i++)
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_min_set(objects[i], EINA_SIZE2D(val, val));
|
2016-04-13 19:12:44 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
padding_slider_cb(void *data, const Efl_Event *event)
|
2016-04-13 19:12:44 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(data, val, val, EINA_TRUE);
|
2016-04-13 19:12:44 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
margin_slider_cb(void *data, const Efl_Event *event)
|
2016-04-13 19:12:44 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_set(data, val, val, val, val);
|
2016-04-13 19:12:44 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
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 11:45:27 -08:00
|
|
|
btnmargins_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
2016-04-13 19:12:44 -07:00
|
|
|
{
|
2016-05-18 08:17:36 -07:00
|
|
|
int val = elm_slider_value_get(event->object);
|
2016-04-13 19:12:44 -07:00
|
|
|
for (int i = 1; i < 7; i++)
|
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 11:45:27 -08:00
|
|
|
efl_gfx_hint_margin_set(objects[i], val, val, val, val);
|
2016-04-13 19:12:44 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void
|
|
|
|
alignv_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
double ax, val;
|
|
|
|
|
|
|
|
val = elm_slider_value_get(event->object);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_get(objects[1], &ax, NULL);
|
|
|
|
efl_gfx_hint_align_set(objects[1], ax, val);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
alignh_slider_cb(void *data EINA_UNUSED, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
double ay, val;
|
|
|
|
|
|
|
|
val = elm_slider_value_get(event->object);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_get(objects[1], NULL, &ay);
|
|
|
|
efl_gfx_hint_align_set(objects[1], val, ay);
|
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
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
layout_updated_cb(void *data, const Efl_Event *event)
|
2016-04-14 00:41:57 -07:00
|
|
|
{
|
|
|
|
Elm_Label *o = data;
|
|
|
|
char buf[64];
|
|
|
|
int rows, cols, count;
|
|
|
|
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table_size_get(event->object, &cols, &rows);
|
2016-05-18 08:17:36 -07:00
|
|
|
count = efl_content_count(event->object);
|
2016-04-14 00:41:57 -07:00
|
|
|
sprintf(buf, "%d items (%dx%d)", count, cols, rows);
|
|
|
|
elm_object_text_set(o, buf);
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
child_evt_cb(void *data, const Efl_Event *event)
|
2016-04-14 00:41:57 -07:00
|
|
|
{
|
|
|
|
Elm_Label *o = data;
|
2018-04-05 01:47:26 -07:00
|
|
|
Efl_Gfx_Entity *it = event->info;
|
2016-04-14 00:41:57 -07:00
|
|
|
int col, row, colspan, rowspan;
|
|
|
|
char buf[64];
|
|
|
|
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table_position_get(event->object, it, &col, &row, &colspan, &rowspan);
|
2016-04-19 22:55:26 -07:00
|
|
|
if (event->desc == EFL_CONTAINER_EVENT_CONTENT_ADDED)
|
2016-04-14 00:41:57 -07:00
|
|
|
sprintf(buf, "pack %d,%d %dx%d", col, row, colspan, rowspan);
|
|
|
|
else
|
|
|
|
sprintf(buf, "unpack %d,%d %dx%d", col, row, colspan, rowspan);
|
|
|
|
elm_object_text_set(o, buf);
|
|
|
|
}
|
|
|
|
|
2016-04-18 04:17:24 -07:00
|
|
|
static void
|
2017-04-16 21:41:29 -07:00
|
|
|
_custom_layout_update(Eo *pack, void *_pd EINA_UNUSED)
|
2016-04-18 04:17:24 -07:00
|
|
|
{
|
2017-12-18 21:13:58 -08:00
|
|
|
/* Example custom layout for table:
|
2016-04-18 04:17:24 -07:00
|
|
|
* divide space into regions of same size, place objects in center of their
|
|
|
|
* cells using their min size
|
2017-09-14 20:14:32 -07:00
|
|
|
* Note: This is a TERRIBLE layout function (disregards align, weig.ht, ...)
|
2016-04-18 04:17:24 -07:00
|
|
|
*/
|
|
|
|
|
2017-09-14 20:14:32 -07:00
|
|
|
int rows, cols, c, r, cs, rs, gmw = 0, gmh = 0;
|
2016-04-18 04:17:24 -07:00
|
|
|
Eina_Iterator *it;
|
2017-09-14 20:14:32 -07:00
|
|
|
Eina_Rect g;
|
2016-04-18 04:17:24 -07:00
|
|
|
Eo *item;
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
g = efl_gfx_entity_geometry_get(pack);
|
2016-04-18 04:17:24 -07:00
|
|
|
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table_size_get(pack, &cols, &rows);
|
2016-04-18 04:17:24 -07:00
|
|
|
if (!cols || !rows) goto end;
|
|
|
|
|
2016-04-19 22:55:26 -07:00
|
|
|
it = efl_content_iterate(pack);
|
2016-04-18 04:17:24 -07:00
|
|
|
EINA_ITERATOR_FOREACH(it, item)
|
|
|
|
{
|
2017-12-18 21:13:58 -08:00
|
|
|
if (efl_pack_table_position_get(pack, item, &c, &r, &cs, &rs))
|
2016-04-18 04:17:24 -07:00
|
|
|
{
|
2017-09-14 20:14:32 -07:00
|
|
|
Eina_Rect m;
|
2016-04-18 04:17:24 -07:00
|
|
|
|
2018-02-14 14:03:47 -08:00
|
|
|
m.x = g.x + c * g.w / cols + (cs * g.w / cols - g.x) / 2;
|
|
|
|
m.y = g.y + r * g.h / rows + (rs * g.h / rows - g.y) / 2;
|
2019-02-21 09:19:45 -08:00
|
|
|
m.size = efl_gfx_hint_size_combined_min_get(item);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_geometry_set(item, m);
|
2016-04-18 04:17:24 -07:00
|
|
|
|
2017-09-14 20:14:32 -07:00
|
|
|
gmw = MAX(gmw, m.w);
|
|
|
|
gmh = MAX(gmh, m.h);
|
2016-04-18 04:17:24 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_iterator_free(it);
|
|
|
|
|
|
|
|
end:
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_min_set(pack, EINA_SIZE2D(gmw * cols, gmh * rows));
|
2016-04-18 04:17:24 -07:00
|
|
|
}
|
|
|
|
|
2016-04-13 19:12:44 -07:00
|
|
|
void
|
2017-12-18 21:13:58 -08:00
|
|
|
test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2016-04-13 19:12:44 -07:00
|
|
|
{
|
2017-12-18 21:13:58 -08:00
|
|
|
Evas_Object *win, *bx, *o, *vbox, *f, *hbox, *chk, *table;
|
2016-04-13 19:12:44 -07:00
|
|
|
int i = 0;
|
|
|
|
|
2017-12-18 21:13:58 -08:00
|
|
|
win = elm_win_util_standard_add("ui-table", "Efl.Ui.Table");
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400));
|
2016-04-13 19:12:44 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
vbox = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(vbox, 1, 1);
|
|
|
|
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_win_resize_object_add(win, vbox);
|
|
|
|
|
|
|
|
|
|
|
|
// create here to pass in cb
|
2017-12-18 21:13:58 -08:00
|
|
|
table = efl_add(EFL_UI_TABLE_CLASS, win);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* controls */
|
|
|
|
f = elm_frame_add(win);
|
|
|
|
elm_object_text_set(f, "Controls");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(f, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(f, 1, 0);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(vbox, f);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(f, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
hbox = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL));
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_object_content_set(f, hbox);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* weights radio group */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
chk = o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "No weight");
|
2019-05-29 11:06:25 -07:00
|
|
|
evas_object_smart_callback_add(o, "changed", weights_cb, table);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_radio_state_value_set(o, NONE);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
2017-12-18 21:13:58 -08:00
|
|
|
elm_object_text_set(o, "No weight + table fill");
|
2019-05-29 11:06:25 -07:00
|
|
|
evas_object_smart_callback_add(o, "changed", weights_cb, table);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_radio_state_value_set(o, NONE_BUT_FILL);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "Equal weights");
|
2019-05-29 11:06:25 -07:00
|
|
|
evas_object_smart_callback_add(o, "changed", weights_cb, table);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_radio_state_value_set(o, EQUAL);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "One weight only");
|
2019-05-29 11:06:25 -07:00
|
|
|
evas_object_smart_callback_add(o, "changed", weights_cb, table);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_radio_state_value_set(o, ONE);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "Two weights");
|
2019-05-29 11:06:25 -07:00
|
|
|
evas_object_smart_callback_add(o, "changed", weights_cb, table);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_radio_state_value_set(o, TWO);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
2016-04-18 04:17:24 -07:00
|
|
|
o = elm_radio_add(win);
|
|
|
|
elm_object_text_set(o, "Custom layout");
|
2019-05-29 11:06:25 -07:00
|
|
|
evas_object_smart_callback_add(o, "changed", weights_cb, table);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0, 0.5);
|
2016-04-18 04:17:24 -07:00
|
|
|
elm_radio_state_value_set(o, CUSTOM);
|
|
|
|
elm_radio_group_add(o, chk);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-18 04:17:24 -07:00
|
|
|
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_radio_value_set(chk, EQUAL);
|
|
|
|
|
|
|
|
|
2016-06-09 00:42:09 -07:00
|
|
|
/* min size setter */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
2016-06-09 00:42:09 -07:00
|
|
|
elm_object_text_set(o, "User min size");
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-06-12 00:06:22 -07:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, user_min_slider_cb, NULL);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 250);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
|
|
|
elm_slider_value_set(o, 0);
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* inner box padding */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Padding");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, padding_slider_cb, table);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 40);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
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 11:45:27 -08:00
|
|
|
elm_slider_value_set(o, 0);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* outer margin */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 0, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Margin");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, margin_slider_cb, table);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 40);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
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 11:45:27 -08:00
|
|
|
elm_slider_value_set(o, 0);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* button margins */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 1, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Buttons margins");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.0fpx");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, btnmargins_slider_cb, table);
|
2016-04-13 19:12:44 -07:00
|
|
|
elm_slider_min_max_set(o, 0, 40);
|
|
|
|
elm_slider_inverted_set(o, 1);
|
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 11:45:27 -08:00
|
|
|
elm_slider_value_set(o, 0);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
|
|
|
|
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
|
|
|
/* button1 aligns */
|
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 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
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "Button1 align");
|
|
|
|
efl_pack(bx, o);
|
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.1f");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 0);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 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
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_slider_cb, NULL);
|
|
|
|
elm_slider_min_max_set(o, 0, 1);
|
|
|
|
elm_slider_value_set(o, 0.3);
|
|
|
|
efl_pack(bx, o);
|
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
|
|
|
|
|
|
|
o = elm_slider_add(win);
|
|
|
|
elm_slider_indicator_format_set(o, "%.1f");
|
|
|
|
elm_slider_indicator_show_set(o, 1);
|
|
|
|
elm_slider_horizontal_set(o, 1);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(o, 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
|
|
|
efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, NULL);
|
|
|
|
elm_slider_min_max_set(o, 0, 1);
|
|
|
|
elm_slider_value_set(o, 0.3);
|
|
|
|
efl_pack(bx, o);
|
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
|
|
|
|
2016-04-14 00:41:57 -07:00
|
|
|
/* ro info */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 1, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
efl_pack(hbox, bx);
|
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "<b>Properties</>");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
o = elm_label_add(win);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(table, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
|
2016-04-14 00:41:57 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
o = elm_label_add(win);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
|
|
|
|
efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, 0);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
|
2016-04-13 19:12:44 -07:00
|
|
|
/* contents */
|
|
|
|
f = elm_frame_add(win);
|
|
|
|
elm_object_text_set(f, "Contents");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(f, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(f, 1, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
efl_pack(vbox, f);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(f, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2017-12-18 21:13:58 -08:00
|
|
|
elm_object_content_set(f, table);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(table, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
objects[i++] = o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_size_min_set(o, EINA_SIZE2D(10, 10));
|
2016-06-09 00:42:09 -07:00
|
|
|
efl_gfx_color_set(o, 64, 96, 128, 255);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 0, 0, 3, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
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
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, "Button 1");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_align_set(o, 0.3, 0.3);
|
|
|
|
efl_gfx_hint_size_max_set(o, EINA_SIZE2D(100, 100));
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 0, 0, 1, 1);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
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
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, "Button 2");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 1, 0, 1, 1);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
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
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, "Button 3");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 2, 0, 1, 1);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
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
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, "Button 4");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 0, 1, 2, 1);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
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
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, "Button 5");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 2, 1, 1, 2);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
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
|
|
|
objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, "Button 6");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_TRUE, EINA_TRUE);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table(table, o, 0, 2, 2, 1);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(win, 1);
|
2016-04-13 19:12:44 -07:00
|
|
|
}
|
2016-04-13 22:12:16 -07:00
|
|
|
|
|
|
|
static const char *
|
|
|
|
btn_text(const char *str)
|
|
|
|
{
|
|
|
|
static char buf[64];
|
|
|
|
static int id = 0;
|
|
|
|
sprintf(buf, "%s %d", str ?: "item", ++id);
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
remove_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
2016-04-13 22:12:16 -07:00
|
|
|
{
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_del(ev->object);
|
2016-04-13 22:12:16 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
append_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
2016-04-13 22:12:16 -07:00
|
|
|
{
|
2017-12-18 21:13:58 -08:00
|
|
|
Eo *table = data;
|
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
|
|
|
Eo *o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, btn_text("appended"));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL);
|
2016-04-13 22:12:16 -07:00
|
|
|
elm_object_tooltip_text_set(o, "Click to unpack");
|
efl.pack_table: inherit efl.pack instead of efl.pack_linear
Summary:
>>! In T5301#110572, @jpeg wrote:
> Quick recap before I leave.
> ...
> ...
> - Pack interfaces - T5328
>
> Table does not need to inherit from "linear" (1d) layout: this brings unnecessary complexity, for a dubious use case.
We don't have linear layout policy of table(2d) layout. furthermore, i don't
think it will be clearly defined. it is enough for Efl.Pack_Table to support
`efl_pack` which work the same as `efl_pack_end`.
ref T5719, T5328
Test Plan:
- make
- elementary_test -to 'efl.ui.table'
- elementary_test -to 'efl.ui.table(linear api)'
Reviewers: zmike, woohyun, segfaultxavi
Reviewed By: segfaultxavi
Subscribers: cedric, #reviewers, jpeg, #committers
Tags: #efl
Maniphest Tasks: T5719, T5328
Differential Revision: https://phab.enlightenment.org/D8420
2019-03-20 04:45:00 -07:00
|
|
|
efl_pack(table, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
clear_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
2016-04-13 22:12:16 -07:00
|
|
|
{
|
2017-12-18 21:13:58 -08:00
|
|
|
Eo *table = data;
|
|
|
|
efl_pack_clear(table);
|
2016-04-13 22:12:16 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-12-18 21:13:58 -08:00
|
|
|
test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
2016-04-13 22:12:16 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
2017-12-18 21:13:58 -08:00
|
|
|
Evas_Object *win, *o, *vbox, *f, *hbox, *table, *ico, *bx;
|
2016-04-13 22:12:16 -07:00
|
|
|
|
2017-12-18 21:13:58 -08:00
|
|
|
win = elm_win_util_standard_add("ui-table-linear", "Efl.Ui.Table Linear APIs");
|
2016-04-13 22:12:16 -07:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_size_set(win, EINA_SIZE2D(600, 400));
|
2016-04-13 22:12:16 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
vbox = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
|
2016-04-13 22:12:16 -07:00
|
|
|
elm_win_resize_object_add(win, vbox);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(vbox, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
// create here to pass in cb
|
2017-12-18 21:13:58 -08:00
|
|
|
table = efl_add(EFL_UI_TABLE_CLASS, win);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
|
|
|
|
|
|
|
/* controls */
|
|
|
|
f = elm_frame_add(win);
|
|
|
|
elm_object_text_set(f, "Controls");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(f, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(f, 1, 0);
|
2016-04-13 22:12:16 -07:00
|
|
|
efl_pack(vbox, f);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(f, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
2017-08-09 06:36:29 -07:00
|
|
|
hbox = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL));
|
2016-04-13 22:12:16 -07:00
|
|
|
elm_object_content_set(f, hbox);
|
2019-04-24 06:41:39 -07:00
|
|
|
efl_gfx_arrangement_content_padding_set(hbox, 5, 0, EINA_TRUE);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(hbox, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
|
|
|
ico = elm_icon_add(win);
|
|
|
|
elm_icon_standard_set(ico, "list-add");
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_content_set(o, ico);
|
|
|
|
elm_object_text_set(o, "Append");
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, append_cb, table);
|
2016-04-13 22:12:16 -07:00
|
|
|
efl_pack(hbox, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
|
|
|
ico = elm_icon_add(win);
|
|
|
|
elm_icon_standard_set(ico, "edit-clear-all");
|
|
|
|
o = elm_button_add(win);
|
|
|
|
elm_object_content_set(o, ico);
|
|
|
|
elm_object_text_set(o, "Clear");
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, clear_cb, table);
|
2016-04-13 22:12:16 -07:00
|
|
|
efl_pack(hbox, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
|
|
|
|
2016-04-14 00:41:57 -07:00
|
|
|
/* ro info */
|
2016-08-15 06:44:41 -07:00
|
|
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(bx, 0, 0.5);
|
|
|
|
efl_gfx_hint_fill_set(bx, EINA_FALSE, EINA_TRUE);
|
|
|
|
efl_gfx_hint_weight_set(bx, 1, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
efl_pack(hbox, bx);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(bx, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
o = elm_label_add(win);
|
|
|
|
elm_object_text_set(o, "<b>Properties</>");
|
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
o = elm_label_add(win);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(table, EFL_PACK_EVENT_LAYOUT_UPDATED, layout_updated_cb, o);
|
2016-04-14 00:41:57 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
o = elm_label_add(win);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_ADDED, child_evt_cb, o);
|
|
|
|
efl_event_callback_add(table, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child_evt_cb, o);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(o, 0.5, 0);
|
|
|
|
efl_gfx_hint_weight_set(o, 1, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
efl_pack(bx, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-14 00:41:57 -07:00
|
|
|
|
|
|
|
|
2016-04-13 22:12:16 -07:00
|
|
|
/* contents */
|
|
|
|
f = elm_frame_add(win);
|
|
|
|
elm_object_text_set(f, "Contents");
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_align_set(f, -1, -1);
|
|
|
|
efl_gfx_hint_weight_set(f, 1, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
efl_pack(vbox, f);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(f, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack_table_columns_set(table, 4);
|
2019-05-24 09:30:31 -07:00
|
|
|
efl_ui_layout_orientation_set(table, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
2017-12-18 21:13:58 -08:00
|
|
|
elm_object_content_set(f, table);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(table, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
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
|
|
|
o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, btn_text(NULL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack(table, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
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
|
|
|
o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, btn_text(NULL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack(table, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
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
|
|
|
o = efl_add(EFL_UI_BUTTON_CLASS, table);
|
|
|
|
efl_text_set(o, btn_text(NULL));
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_set(o, 0, 0);
|
|
|
|
efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE);
|
2019-07-29 02:42:34 -07:00
|
|
|
efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL);
|
2017-12-18 21:13:58 -08:00
|
|
|
efl_pack(table, o);
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(o, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
efl_gfx_entity_visible_set(win, 1);
|
2016-04-13 22:12:16 -07:00
|
|
|
}
|