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

background color does not work for most components #687

Open
AlexanderGrathIBO opened this issue Jan 8, 2025 · 5 comments
Open

background color does not work for most components #687

AlexanderGrathIBO opened this issue Jan 8, 2025 · 5 comments
Assignees
Labels

Comments

@AlexanderGrathIBO
Copy link

Describe the bug
For some components (I can confirm label, image and container) the background color does not appear.

To Reproduce
Steps to reproduce the behavior:

  1. create a LVGL project (8.x)
  2. add a label to the screen
  3. change background color
  4. nothing happens, neither in the preview, nor when you click run, nor when I upload it to my device/screen

Expected behavior
For the background color to change.

Screenshots
Screenshot 2025-01-08 at 11 49 41

Desktop (please complete the following information):

  • OS: [macOS]
  • Version [15.1.1]
  • Apple M2

** LVGL version (if used)**

  • 8.x

Additional context
It will change the code of screens.c, button works without problems and the code looks basically identical.
Potentially related issue: #644

@RamasyaR
Copy link

RamasyaR commented Jan 8, 2025

Change the opacity to 255 and you will see the background

@AlexanderGrathIBO
Copy link
Author

AlexanderGrathIBO commented Jan 8, 2025

Oh, that is an embarrassing oversight on my side, thanks for the fast response.

I would suggest setting that to 255 on default (when color is set).

@AlexanderGrathIBO
Copy link
Author

So for anybody finding this with similar problems:
First check the opacity, some components have it set to 255 as the default value, some don't. You can set a new style, change it to the default value you want and than use that as the new default for the component.

The issue I had and why I opened this issue:
If you have a smaller screen make sure you can actually see all the UI elements. There is a button at the top right (within every sub-window) to enlarge it.
I thought I was going insane, sometimes things would work sometimes not, turns out I couldn't see all the settings and I was changing things in 'selected part'/'Ticks part' etc. and was wondering why none of the changes would do anything to the default behavior.

@mvladic
Copy link
Contributor

mvladic commented Jan 9, 2025

We are using LVGL default values for the opacity. For example, Button widget has 255 opacity by default and Label widget has 0.

@mvladic
Copy link
Contributor

mvladic commented Jan 9, 2025

I would suggest setting that to 255 on default (when color is set).

This makes sense. We can change opacity to 255 if it was 0 when color is changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants