efl_ui_layout: remove group_calcualte to respect legacy min size
Summary:
For legacy elm_layout, the size should be calculated based on
`hint_size_combined_min` instead of `hint_size_min` in the group_calculate.
Also, `_efl_ui_layout_efl_canvas_group_group_calculate` is unnecessary because
it is added to allow finger size policy differentiation between inherited layout
and layout object (see also, 46cf288d32
), however,
it can be set by `finger_size_multiplier` proeprty in constructor.
Test Plan:
Check `evas_object_size_hint_min_set` is respected.
layout_example.c
```
//Compile with:
//edje_cc layout_example.edc && gcc -g layout_example.c -o layout_example `pkg-config --cflags --libs elementary`
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
Evas_Object *win, *layout, *box;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("layout", "Layout");
elm_win_autodel_set(win, EINA_TRUE);
box = elm_box_add(win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(box);
elm_win_resize_object_add(win, box);
layout = elm_layout_add(box);
evas_object_size_hint_min_set(layout, 300, 200);
elm_layout_file_set(layout, "./layout_example.edj", "mylayout");
evas_object_show(layout);
elm_box_pack_end(box, layout);
evas_object_resize(win, 300, 300);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
layout_example.edc
```
collections {
group {
name: "mylayout";
parts {
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
color: 100 190 100 255;
}
}
part {
name: "mytext1";
type: TEXT;
description {
state: "default" 0.0;
text {
size: 30;
text: "my text1";
min: 1 0;
}
color: 0 255 0 255;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 0.3;
}
}
}
parts {
part {
name: "mytext2";
type: TEXT;
description {
state: "default" 0.0;
text {
size: 30;
text: "my text2";
min: 1 0;
}
color: 0 255 255 255;
rel1.relative: 0.0 0.3;
rel2.relative: 1.0 0.6;
}
}
}
}
}
```
Reviewers: zmike, Jaehyun_Cho, woohyun
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11858
This commit is contained in:
parent
0332991a4d
commit
a227b83f41
|
@ -1000,13 +1000,6 @@ _efl_ui_layout_base_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd)
|
|||
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_layout_efl_canvas_group_group_calculate(Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
efl_canvas_group_need_recalculate_set(obj, EINA_FALSE);
|
||||
_sizing_eval(obj, efl_data_scope_get(obj, MY_CLASS), NULL);
|
||||
}
|
||||
|
||||
/* rewrite or extend this one on your derived class as to suit your
|
||||
* needs */
|
||||
EOLIAN static void
|
||||
|
|
|
@ -19,6 +19,5 @@ class Efl.Ui.Layout extends Efl.Ui.Layout_Base implements Efl.File
|
|||
Efl.File.load;
|
||||
Efl.File.unload;
|
||||
Efl.Object.constructor;
|
||||
Efl.Canvas.Group.group_calculate;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue