From a227b83f41adc3d8ca5f27c36f4e708d2f508c35 Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Wed, 20 May 2020 16:36:15 +0900 Subject: [PATCH] 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, 46cf288d32f06a0c82ef227c65e55062bf494672), 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 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 --- src/lib/elementary/efl_ui_layout.c | 7 ------- src/lib/elementary/efl_ui_layout.eo | 1 - 2 files changed, 8 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 34a9c2967e..1839406cb0 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -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 diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout.eo index 39a10b4a99..ab4d67c1e3 100644 --- a/src/lib/elementary/efl_ui_layout.eo +++ b/src/lib/elementary/efl_ui_layout.eo @@ -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; } }