Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow background colour (mcolor) for labels #20

Closed
scopa90 opened this issue Aug 28, 2017 · 7 comments
Closed

Allow background colour (mcolor) for labels #20

scopa90 opened this issue Aug 28, 2017 · 7 comments

Comments

@scopa90
Copy link
Contributor

scopa90 commented Aug 28, 2017

It might be good to allow the background colour of a label to be set via mcolor and inherit the parent object's mcolor if it's not supplied.

@kisvegabor
Copy link
Member

Hi,
it is a good idea, thank you!
Do you mean if the label's style is NULL (inherited from parent) use transparent background and use mcolor as background color if label's style is explicitly set? Maybe the empty style attribute can disable this feature.

@scopa90
Copy link
Contributor Author

scopa90 commented Aug 28, 2017

Or just keep it as transparent unless it's explcitly set?

@kisvegabor
Copy link
Member

Currently there is no tracking for a unique style attribute (like mcolor) whether it is set or not. Only I can see the entire style is inherited or not.

@kisvegabor
Copy link
Member

kisvegabor commented Aug 28, 2017

If we think it further the label can use all backround related style attributes like mcolor, gcolor, bcolor, bopa etc. but only if its style is set explicitly. Else only use the inherited font, ccolor, letter space etc

What do you think?

@kisvegabor
Copy link
Member

kisvegabor commented Sep 11, 2017

I added the update to beta. Now if a label's style is set by lv_obj_set_style() to not NULL then background will be drawn.
To avoid drawing background set empty=1 and bwidth=0 properties or copy LV_STYLE_TRANSP when initializing a new label style.

Tests are still needed to see how it effect existing objects where labels are used.

@scopa90
Copy link
Contributor Author

scopa90 commented Sep 16, 2017

Just had chance to test this but only for a straight label. Looks very good.

@scopa90 scopa90 closed this as completed Sep 16, 2017
@kisvegabor
Copy link
Member

Thanks for testing!

@kisvegabor kisvegabor added this to To do in Release: v5.0 Oct 19, 2017
@kisvegabor kisvegabor removed this from To do in Release: v5.0 Oct 19, 2017
kisvegabor pushed a commit that referenced this issue Aug 19, 2021
lv_canvas: basic drawing functionalities: screenshot
kisvegabor added a commit that referenced this issue Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants