Commit Graph

11 Commits

Author SHA1 Message Date
Mike Blumenkrantz 7e517e2a11 elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)

the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split

this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync

the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size

Depends on D9438

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9439
2019-07-30 13:12:52 -04:00
Yeongjong Lee 56ab05660e efl_ui_relative_layout: prevent infinite loop in chain calculation
Test Plan:
test code
```
EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Eo *win, *layout, *btn1, *btn2, *btn3;

   win =  efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get());
   layout = efl_add(EFL_UI_RELATIVE_LAYOUT_CLASS, win,
                    efl_content_set(win, efl_added));

   btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout);
   btn2 = efl_add(EFL_UI_BUTTON_CLASS, layout);

   efl_ui_relative_layout_relation_right_set(layout, btn1, btn2, 0.0);
   efl_ui_relative_layout_relation_right_set(layout, btn2, btn1, 0.0);

   efl_ui_relative_layout_relation_left_set(layout, btn2, btn1, 1.0);
   efl_ui_relative_layout_relation_left_set(layout, btn1, btn2, 1.0);

   elm_run();
   return 0;
}
ELM_MAIN()
```

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9032
2019-05-29 17:24:30 +09:00
Yeongjong Lee e3a791c4b1 efl_ui_relative_layout: allow to respect the min size of its child
Summary: It will have the same policy as the Efl.Ui.Box, Table.

Test Plan: elementary_test -to 'efl.ui.relative_layout'

Reviewers: Jaehyun_Cho, herb

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9029
2019-05-29 17:24:21 +09:00
Yeongjong Lee 2426656fd6 ui.relative_layout: implement Efl.Pack
Now, efl_content_iterate, efl_content_count, efl_pack, efl_pack_unpack,
efl_pack_unpack_all and efl_pack_clear are available for relative_layout.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8631
2019-05-03 11:53:54 +02:00
Jaehyun Cho f3b9f7f0d8 efl_ui: fix not to call _on_child_del() after container is deleted
If efl_ref() is called to child, then child may not be deleted when
container is deleted.
This causes _on_child_del() is called after container is deleted and it
causes crash if container data is accessed in _on_child_del().

To resolve the above issue, all callbacks of child are deleted not to
call _on_child_del() after container is deleted.
2019-04-26 18:25:50 +09:00
Yeongjong Lee 5b2b75a7f2 ui.relative_layout: fix incorrect type casting
Summary: `temph` can be double type.

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8695
2019-04-24 21:09:54 +09:00
Yeongjong Lee 9b87eaee08 ui.relative_layout: add callbacks to update layout
Summary:
If the size or hints of a child changes, relative_layout need to update layout.
And, if a child is deleted, it should be unregisterd from relative_layout.

Depends on D8625

Test Plan: elementary_test -to 'efl.ui.relative_layout'

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8626
2019-04-24 20:32:45 +09:00
Yeongjong Lee 336500469a ui.relative_layout: add internal clipper
Summary: If there is no clipper of container, color_set and clipper_set api won't work.

Test Plan:
1. elementary_test -to 'efl.ui.relative_layout'
2. Click button1
3. check that buttons color are changed.

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8625
2019-04-24 20:23:52 +09:00
Yeongjong Lee ef3281c924 ui.relative_layout: replace evas_object_event_callback_xxx with efl_event_callback_xxx
remove legacy function

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8630
2019-04-21 12:13:12 +02:00
Yeongjong Lee 41136db8e8 ui.widget: remove elm_widget_sub_object_parent_add from each of widgets
since commit a1addad60e, To add myself as a sub object of parent object will be
done in Efl.Ui.Widget constructor.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8280
2019-04-18 11:01:19 +02:00
Yeongjong Lee 3118bfc34b efl_ui_relative_layout: introduce new relative container
Summary:
Efl.Ui.Relative_Layout is a container which allows you to position and size with
relation to each other.
it is possible to position and size using relation like edje even though
you don't know a edc script.
Position and size can be changed dynamically using widget APIs.

@feature

ref T5487

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

Reviewers: cedric, Hermet, Jaehyun_Cho, zmike, bu5hm4n, jpeg, segfaultxavi

Reviewed By: Jaehyun_Cho, segfaultxavi

Subscribers: segfaultxavi, kimcinoo

Tags: #efl

Maniphest Tasks: T5487

Differential Revision: https://phab.enlightenment.org/D7524
2019-02-22 19:47:47 +09:00