Page MenuHomePhabricator

ui.box: refactor layout_update
ClosedPublic

Authored by YOhoho on Thu, Jan 24, 1:35 AM.

Details

Summary

Current layout_update doesn't consider max hint priority. for example, if it
has hint_max, the size is hint_max value regardless of weight or fill.
moreover, if it has hint_aspect with hint_max, hint_min can be ignored.
(test that aspect(1,3) max(50,150), min(70, 70) then, size has (50, 150))
It seems that hint_max is considered as high priority. however, if hint_min
greater than hint_max, hint_max is ignored.

In order to resolve the hint priority conflict, this refactoring supports
following hint priority.

  1. HintMin
  2. HintMin + HintAspect
  3. HintMargin
  4. HintMax
  5. HintAspect
  6. HintWeight, HintFill
  7. HintAlign

ref T5487

Specific unit test is D7463

Test Plan

make check
elementary_test -to 'efl.ui.box'

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
YOhoho created this revision.Thu, Jan 24, 1:35 AM
YOhoho requested review of this revision.Thu, Jan 24, 1:35 AM
YOhoho edited the test plan for this revision. (Show Details)Thu, Jan 24, 1:37 AM
YOhoho updated this revision to Diff 19214.Wed, Feb 6, 7:27 AM

rewrite aspect calculation

Aspect type make race conditon. to resolve this problem, ui_box support only aspect_both type.

YOhoho updated this revision to Diff 19226.Wed, Feb 6, 6:33 PM

remove duplicated code

zmike added a subscriber: zmike.Thu, Feb 7, 10:47 AM

Can you elaborate a bit on what bugs are intended to be fixed?

zmike requested changes to this revision.Fri, Feb 8, 9:13 AM

Really gonna need that explanation in order to review this properly.

This revision now requires changes to proceed.Fri, Feb 8, 9:13 AM
YOhoho added a comment.EditedSun, Feb 10, 3:57 PM

@zmike
Commit message is updated.
And one more important thing - it ensures consistency of hint behavior on containers(box, table(D7841), relative layout(D7524)).

YOhoho updated this revision to Diff 19306.Tue, Feb 12, 1:31 AM

initialize w,h in for loop.

@segfaultxavi what do you think about adding this hint priority to documentation somewhere?

I think the right place to describe this is in the documentation for the Efl.Gfx.Size_Hint class, in src/lib/efl/interfaces/efl_gfx_size_hint.eo.
Each hint is described on its own, but the priorities could be described in the class docs.
I will take care of this in T7694.

There's a tutorial about UI sizing, but right now it is extremely poor:
https://www.enlightenment.org/develop/guides/c/ui/sizing.md

zmike accepted this revision.Tue, Feb 12, 6:55 AM
This revision is now accepted and ready to land.Tue, Feb 12, 6:55 AM
YOhoho updated this revision to Diff 19349.Wed, Feb 13, 4:50 AM

fix aspect calculation bug

Closed by commit rEFL846492ebd7b8: ui.box: refactor layout_update (authored by Yeongjong Lee <yj34.lee@samsung.com>, committed by zmike). · Explain WhyWed, Feb 13, 6:23 AM
This revision was automatically updated to reflect the committed changes.