Page MenuHomePhabricator

edje & elm sizing: respect hints & simplify layout api
Closed, ResolvedPublic


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.

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.

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.

YOhoho added a comment.EditedDec 16 2018, 5:49 PM

If you use aspect, max and min hints together in Efl.Ui.Box, there is wired behavior. furthermore, there is no way to use max, align(SIZE_HINT_FILL) hints together. so, i want to suggest a little idea to solve this problem.
The first is fill hint. if a widget use both hint_align(HINT_FILL) and hint_max together, there is no way to set to hint_align. (D7409)
Here is new priority with fill hint and the test cases. (D7463)

2HintMin + HintAspect
6HintWeight, HintFill

zmike added a comment.Sep 3 2019, 12:03 PM

I think this is all resolved now?

YOhoho claimed this task.Sep 3 2019, 3:41 PM
YOhoho added a subscriber: thiepha.

Yes, i think so.

YOhoho closed this task as Resolved.Sep 3 2019, 3:41 PM