Page MenuHomePhabricator

efl_ui_layout: create efl_ui_bg when efl_part for background is called.
ClosedPublic

Authored by taxi2se on Aug 30 2017, 11:29 PM.

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.
taxi2se created this revision.Aug 30 2017, 11:29 PM

This is an experimental test to find proper way to supprot background property which can be used commonly among all elementary widgets.
This should be checked with D5147.
Please refer to T5716.

taxi2se updated this revision to Diff 12857.Nov 2 2017, 9:58 PM

rebase and apply change in efl_part interface.

taxi2se updated this revision to Diff 12858.Nov 2 2017, 10:03 PM

Fix warning message when bg property is not implemented.

taxi2se updated this revision to Diff 12861.Nov 3 2017, 12:52 AM

use eina_streq() rather than !strcmp()

bg_add is still ambiguous for me. Except that I don't have any objection about your codes :)

taxi2se updated this revision to Diff 12873.Nov 5 2017, 6:51 PM

Fix document description.

taxi2se updated this revision to Diff 12892.Nov 6 2017, 10:34 PM

remove bg_add method and set color to 0, 0, 0, 0

jpeg added a comment.Nov 7 2017, 12:31 AM

Why is this in layout and not widget?

In D5151#92643, @jpeg wrote:

Why is this in layout and not widget?

I was not sure whether efl_part for widget still use efl_content_set interface.
Is there any plan about making Efl.Ui.Widget.Part_Content or something?
And when we talked over this with cedric and felipe, the conclusion I remember was
"background is in widget, but will be implemented in layout."

In D5151#92643, @jpeg wrote:

Why is this in layout and not widget?

I was not sure whether efl_part for widget still use efl_content_set interface.

Is there any plan about making Efl.Ui.Widget.Part_Content or something?

The part for "background" would implement the bg interface. So this is not quite relevant.

And when we talked over this with cedric and felipe, the conclusion I remember was
"background is in widget, but will be implemented in layout."

Well this doesn't make any sense. @cedric or @felipealmeida do you remember?

taxi2se added a comment.EditedNov 7 2017, 4:22 AM
In D5151#92719, @jpeg wrote:
In D5151#92643, @jpeg wrote:

Why is this in layout and not widget?

I was not sure whether efl_part for widget still use efl_content_set interface.

Is there any plan about making Efl.Ui.Widget.Part_Content or something?

The part for "background" would implement the bg interface. So this is not quite relevant.

I am confused.
Is bg interface like

efl_bg_color_set(obj, r, g, b, a);

or like

efl_gfx_color_set(efl_part(obj, "background"), r, g, b, a));

Also, how can elm_widget know which API should be called to set or swallow bg.

_elm_widget_bg_set(Eo *obj EINA_UNUSED, Efl_Ui_Widget_Data *pd EINA_UNUSED, Efl_Canvas_Object *background EINA_UNUSED)
{
   WRN("The %s widget does not implement the \"bg\" property.",
       efl_class_name_get(efl_class_get(obj)));
   return EINA_FALSE;
}

Isn't this enough?

Can't say I remember, but I don't see why not use efl_gfx_color_set(efl_part(obj, "background"), r, g, b, a));

It makes more sense to me.

taxi2se updated this revision to Diff 12924.Nov 7 2017, 10:44 PM

remove Efl.Ui.Widget.bg {get;set;}

Bg part will be set by part interface and not going to be used in widget,
thus removed.

taxi2se updated this revision to Diff 12931.Nov 8 2017, 5:37 AM
  • efl_ui_widget: implement background part for efl_ui_widgets

I am going to add test for bg interface soon.

taxi2se updated this revision to Diff 13012.Nov 15 2017, 3:21 AM
  • efl_ui_widget: implement background part for efl_ui_widgets
  • efl_ui_widget: add test for background part
jpeg added a comment.Nov 19 2017, 10:58 PM

I think Layout bg should inherit from Widget bg part. And both of them should implement the Bg interface (or Bg widget API, basically), not the Efl.Ui.Image API. They should look like a Bg widget, except that the user doesn't control their position & size, basically.
Also, I think layout part implementation should call the super function if there is no "background" part in EDC. That way all widgets will have Bg support. In the provided test case we can see that only Box supports bg, because of the required theme work.

taxi2se updated this revision to Diff 13089.Nov 20 2017, 4:53 AM
  • efl_ui_widget: implement background part for efl_ui_widgets
  • efl_ui_widget: add test for background part
  • efl_ui_widget: add Efl.Ui.Widget.Part.Bg.bg property
taxi2se updated this revision to Diff 13109.Nov 20 2017, 11:16 PM
  • efl_ui_widget: implement background part for efl_ui_widgets
  • efl_ui_widget: add test for background part
  • efl_ui_widget: add Efl.Ui.Widget.Part.Bg.bg property
  • efl_ui_widget: exclude bg part from widget color_set
taxi2se updated this revision to Diff 13131.Nov 21 2017, 10:15 PM

efl_ui_widget_part_bg: ELM_PART_OVERRIDE now make bg_part

Closed by commit rEFL3c47a4f9f9ef: efl_ui_layout: create efl_ui_bg when efl_part for background is called. (authored by taxi2se, committed by Jean-Philippe Andre <jp.andre@samsung.com>). · Explain WhyNov 23 2017, 11:13 PM
This revision was automatically updated to reflect the committed changes.