Page MenuHomePhabricator

PROTOTYPE: Efl.Ui.Widget: implement Efl.Gfx.Color_Class
AbandonedPublic

Authored by taxi2se on Jan 25 2018, 11:39 PM.

Details

Summary

this is to suggest implement Efl.Gfx.Color_Class in Efl.Ui.Widget
example:
slider = efl_add(EFL_UI_SLIDER_CLASS, parent);
efl_gfx_color_class_set(slider, "text", EFL_GFX_COLOR_CLASS_LAYER_NORMAL, r, g, b, a);
efl_gfx_color_class_set(efl_part(slider, "popup"), "text", EFL_GFX_COLOR_CLASS_LAYER_NORMAL, r, g, b, a);

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5688
Build 6324: arc lint + arc unit
taxi2se requested review of this revision.Jan 25 2018, 11:39 PM
taxi2se created this revision.
taxi2se edited the summary of this revision. (Show Details)Jan 25 2018, 11:44 PM

Please discuss this with @singh.amitesh. He has pending patches for color. Also for now color_class_code resides in Color instead of Color_Class (it belongs to Color_Class, obviously).

src/lib/edje/edje_util.c
903

Wow! Nice catch!!!
This belongs in a separate patch.

src/lib/elementary/efl_ui_widget.c
908

That's a funny choice of length, but completely arbitrary. I think we don't need this long. ~1024 would be more than enough already.
Anyway, why return strdup() here instead of passing the buffer from the other functions? It would simplify the code and avoid strdup/free.

5998

same comment

jpeg added a comment.Jan 29 2018, 9:21 PM

Oops I pressed Submit too early.
I wonder if it's a good idea to have this API unconditionally format the color class name, as it makes it behave differently between the low-level and the high-level.
Low-level: "efl/button/bg/active" (or whatever the real names are, ofc), and high-level is only "active". Passing "efl/button/bg/active" won't work... It should work.
It sounds like a problem similar to "theme" in Efl.Ui.Layout. What do you think?

src/lib/elementary/efl_ui_widget.c
919

Why "\0" and not simply "" ?

5998

where is "efl/"?

I have added following patches into master branch.

commit e2cb16c78b6dff0ce7d06a24447a8340aff8b1fa
Author: Amitesh Singh <amitesh.sh@samsung.com>
Date:   Thu Dec 21 14:48:41 2017 +0900

    Efl.Gfx.Color: add color_code{}

    color_code allows user to pass/get the color hex string
    (e.g. efl_gfx_color_code_set(o, "#FFAA22CC"))

    Also make this interface as mixin class.
commit 44b6aa16c1054b545583408c31c4243144852960
Author: Amitesh Singh <amitesh.sh@samsung.com>
Date:   Fri Dec 29 13:06:44 2017 +0900

    Efl.Gfx.Color: add color_class_code.set/get{} method

2nd patch should be modified and color_class_code{} should be moved to color_class interface.

Also i tried to keep the common code related to color parsing/processing into one place but i got some magic linking error which i could not figure out at that time when i was working on it.
this code is in my branch devs/ami/color

zmike added a subscriber: zmike.May 2 2018, 3:03 PM

Is this still active? If not, please close the revision.

taxi2se abandoned this revision.May 2 2018, 5:39 PM

no longer active