Page MenuHomePhabricator

efl.ui.textbox: theme code cleanup
ClosedPublic

Authored by ali.alzyod on Jan 15 2020, 12:54 AM.

Details

Summary

You should not theme in _efl_ui_textbox_efl_object_finalize, but rather in theme_apply
All part swallow things should be done in theme_apply.

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.
ali.alzyod created this revision.Jan 15 2020, 12:54 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

ali.alzyod requested review of this revision.Jan 15 2020, 12:54 AM
ali.alzyod edited the summary of this revision. (Show Details)
ali.alzyod added reviewers: woohyun, bu5hm4n.

I know we did not do anything for moving the code, but which part exactly need to move

ali.alzyod added inline comments.Jan 15 2020, 1:03 AM
src/lib/elementary/efl_ui_textbox.c
1872–1873

@bu5hm4n @woohyun
Is this the part that needs to move into theme apply?

bu5hm4n requested changes to this revision.Jan 15 2020, 1:58 AM

When those changes are applied, the theme will be applied automatically during construction.

src/lib/elementary/efl_ui_textbox.c
1864–1865

This is also not needed.

1870–1871

This should be removed entirely, layout will theme itself.

1873

This should be moved.

1915–1916

Two two lines above this should also be moved to theme_apply.

This revision now requires changes to proceed.Jan 15 2020, 1:58 AM
ali.alzyod updated this revision to Diff 28192.Jan 15 2020, 6:57 AM
ali.alzyod edited the summary of this revision. (Show Details)

update

ali.alzyod marked 2 inline comments as done.Jan 15 2020, 6:58 AM
ali.alzyod added inline comments.Jan 15 2020, 7:01 AM
src/lib/elementary/efl_ui_textbox.c
1873

when I try to move _update_text_theme into efl_ui_widget_theme_apply I had many errors, It complains about reading values from wd->resize_obj

I notice:

obj = efl_finalize(efl_super(obj, MY_CLASS));

will call efl_ui_widget_theme_apply, while data in wd->resize_obj is not ready for _update_text_theme

ali.alzyod added inline comments.Jan 15 2020, 8:02 AM
src/lib/elementary/efl_ui_textbox.c
1915–1916

Moving _create_text_cursors(obj, sd); into theme apply also produce alot of errors.

1915–1916
ERR<15684>:eina_safety ../src/lib/evas/canvas/evas_stack.x:168 _efl_canvas_object_efl_gfx_stack_stack_above() Invalid operation: object 'Efl.Canvas.Layout' 0x40000002c51a (parent: 'Efl.Canvas.Layout' 0x40000002910d) not inside same smart parent as above 'Efl.Ui.Table' 0x40000002ad14 (parent '(null)' (nil))!
ERR<15684>:eina_safety ../src/lib/evas/canvas/evas_stack.x:168 _efl_canvas_object_efl_gfx_stack_stack_above() Invalid operation: object 'Efl.Canvas.Layout' 0x40000002e522 (parent: 'Efl.Canvas.Layout' 0x40000002910d) not inside same smart parent as above 'Efl.Ui.Table' 0x40000002ad14 (parent '(null)' (nil))!

Have you moved it *after* the super call to theme_apply?

Have you moved it *after* the super call to theme_apply?

Yes, I moved _update_text_theme after theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS)); but I have same error

ERR<23249>:eina_safety ../src/lib/evas/canvas/evas_object_textblock.c:16175 _efl_canvas_textblock_efl_text_font_properties_font_family_set() safety check failed: font == NULL
ERR<23249>:eina_safety ../src/lib/evas/canvas/evas_object_textblock.c:16209 _efl_canvas_textblock_efl_text_font_properties_font_size_set() safety check failed: size > 0 is false
ERR<23249>:eina_safety ../src/lib/evas/canvas/evas_object_textblock.c:16175 _efl_canvas_textblock_efl_text_font_properties_font_family_set() safety check failed: font == NULL
ERR<23249>:eina_safety ../src/lib/evas/canvas/evas_object_textblock.c:16209 _efl_canvas_textblock_efl_text_font_properties_font_size_set() safety check failed: size > 0 is false
ali.alzyod updated this revision to Diff 28215.Jan 16 2020, 1:34 AM

move _update_text_theme into efl_ui_widget_theme_apply method

ali.alzyod updated this revision to Diff 28219.Jan 16 2020, 3:55 AM

move create_text_cursors and content_set into efl_ui_widget_theme_apply

bu5hm4n accepted this revision.Jan 16 2020, 7:26 AM
This revision is now accepted and ready to land.Jan 16 2020, 7:26 AM
Closed by commit rEFL250c7bd30dc8: efl.ui.textbox: theme code cleanup (authored by ali.alzyod, committed by Marcel Hollerbach <mail@marcel-hollerbach.de>). · Explain WhyJan 16 2020, 7:37 AM
This revision was automatically updated to reflect the committed changes.