Page MenuHomePhabricator

gfx: Add size hint fill (EO)
ClosedPublic

Authored by YOhoho on Dec 3 2018, 11:51 PM.

Details

Summary

If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.

@feature

Test Plan

elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'

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.Dec 3 2018, 11:51 PM
YOhoho requested review of this revision.Dec 3 2018, 11:51 PM
YOhoho updated this revision to Diff 17750.Dec 3 2018, 11:53 PM

update docs.

Jaehyun_Cho requested changes to this revision.Dec 18 2018, 3:28 AM

@YOhoho

"EFL_GFX_SIZE_HINT_FILL" with "hint_align_set" still exists in code.

Please check the above by searching as follows.

grep -nrI "EFL_GFX_SIZE_HINT_FILL" .
grep -nrI "hint_align_set(" . | grep "\-1" | grep -v "evas_object_size_hint_align_set("

This revision now requires changes to proceed.Dec 18 2018, 3:28 AM
YOhoho updated this revision to Diff 18250.Jan 6 2019, 8:21 PM

Fix wrong usecase.

There are some case that legacy widgets use "HINT_FILL(-1)" with "efl_gfx_size_hint_align_set". that cases won't be fixed.

YOhoho updated this revision to Diff 18251.Jan 6 2019, 8:27 PM

Fix typo.

@YOhoho
Could you please check the comments?

src/lib/elementary/efl_ui_box.c
128

did you simply remove this line because fill_set(1, 1) is called in evas_object_main.c?

src/lib/evas/canvas/evas_object_main.c
1837

Is there any reason why obj->legacy.finzlied here?

If the conditional expression here, then error log is not displayed.

e.g. Eo *btn = efl_add(...);

efl_gfx_size_hint_align_set(btn, -1, -1);
1940

Is there any reason why obj->legacy.finzlied here?

YOhoho added inline comments.Jan 15 2019, 12:09 AM
src/lib/elementary/efl_ui_box.c
128

Yes, fill_set(1,1) is default values.

src/lib/evas/canvas/evas_object_main.c
1837

My fault. this condition will be removed. It means align_set allow to set negative values which might be 0 in a container except for -1. in order to avoid confusion of developer who is accustomed to legacy API(HINT_FILL), I'd like to keep -1 as special value implicitly. the special value(-1) is handled in a container.

1940

This is needless condition..

YOhoho updated this revision to Diff 18412.Jan 15 2019, 12:12 AM

Remove needless condition and handle -1 value.

Jaehyun_Cho accepted this revision.Jan 15 2019, 11:44 PM

@YOhoho
Thank you for the patch and updates! It is nice :)

This revision is now accepted and ready to land.Jan 15 2019, 11:44 PM
Closed by commit rEFL78ae9c0ae069: gfx: Add size hint fill (EO) (authored by Yeongjong Lee <yj34.lee@samsung.com>, committed by Jaehyun_Cho). · Explain WhyJan 16 2019, 12:18 AM
This revision was automatically updated to reflect the committed changes.