Page MenuHomePhabricator

edje & elm sizing: respect hints & simplify layout api
Open, HighPublic

Description

This item is part of the EO interfaces work, see T5301.

Layouts in EFL are quite hard to get right because:

  1. Inconsistencies between containers
  2. Hinting API that is often not respected (eg. padding)
  3. Conflicting use of API application-side and framework-side (eg. min_size)

We have basically 3 base containers:

  1. 1D: Box (Efl.Ui.Box derived from elm_box)
  2. 2D: Table (Efl.Ui.Grid derived from elm_table)
  3. Layout (Efl.Canvas.Layout and Efl.Ui.Layout which are currently known as edje_object and elm_layout)

EFL should as much as possible respect the hints provided by the application, and the API usage should not conflict between the application and the framework.

  1. Respect user min_size (2 APIs exist: restricted_min_size and min_size)
  2. Respect padding in box & table - space between children
  3. Respect margin - space around an element
  4. Respect align
  5. Respect weights in the least surprising manner
  6. Respect aspect ratio if it is set
jpeg added a subscriber: barbieri.Jun 15 2017, 7:49 PM

See @barbieri comment in T5301:

it seems that many technologies are moving to the web standard called FLEXBOX and it can be implemented easily on top of our box... actually our box layout looks similar to that, but not exactly. Then why not make a flexbox layout matching the more well known FLEXBOX and stick with that? they have specs, tests... that makes our lives easier.

While at that we go and deprecate all legacy properties (keeping them and the box layout callbacks as legacy-only), claiming we did a cleanup and we're following with the flexbox standard.

Nothing is broken and no extra care needs to be done with legacy other than keeping old code around.

While at that we convert from a layout callback to a layout method, then people can create new layouts by overrides. Of course legacy keep the callbacks, with its layout method is simply a proxy to the set callbacks.

References:

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes
http://learnlayout.com/flexbox.html
jpeg added a subscriber: zmike.Jun 18 2017, 9:36 PM
thiepha added a subscriber: taxi2se.Jul 9 2017, 4:42 PM

Should we check the support for the request size hint which is provided by size_hint_request APIs)?

jpeg added a comment.Jul 10 2017, 3:01 AM

Should we check the support for the request size hint which is provided by size_hint_request APIs)?

I'm not sure we should keep this API, in fact.

cedric raised the priority of this task from TODO to High.Jul 10 2017, 3:05 PM
jpeg added a project: Restricted Project.Jul 11 2017, 10:28 PM
zmike added a comment.Aug 17 2017, 6:48 AM

Is the newly-added aspect handling for box the same as in elm_box?

jpeg added a comment.Aug 22 2017, 2:08 AM

@thiepha please verify the aspect ratio code and make sure my recent fix also applies here. I believe for aspect the handling code should be exactly same.
85d04a74d43a6ec2aa5e595284d5d0fdefeb8f77

YOhoho added a subscriber: YOhoho.Sep 26 2017, 7:24 AM
zmike edited projects, added Restricted Project; removed efl.Jun 11 2018, 6:54 AM
bu5hm4n edited projects, added efl: widgets; removed Restricted Project.Jun 11 2018, 9:15 AM

A #Goal ticket should not be set to a milestone.