Two screens,different theme

Description

The project contains two screens, one eink screen and one color screen. How to use different themes at the same time?

For example, eInk screen uses mono theme, color screen uses alien theme

What MCU/Processor/Board and compiler are you using?

esp32 platformio

What do you want to achieve?

two screens,different theme

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be between ```c and ``` tags:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

You’ll have to manually initialize the two themes and apply their styles individually (without setting them with lv_theme_set_current). Having two different themes on two different displays is not supported AFAIK.

Also, please read and take note of the "Delete this section if you read and applied the mentioned points.` phrase for next time. :wink:

Thank you very much for your reply.

I think this feature will be very helpful for V6 multi-screen support.

But this is just my personal suggestion.

Thank you very much for your contribution to this project.

The multi-screen support pertains more to the idea of just being able to put objects on different displays than separating the whole library.

If you really wanted to have two themes on different displays, and you could create all the objects in advance, you could:

  • Set theme 1 as the current theme.
  • Create all the objects for display 1.
  • Set theme 2 as the current theme.
  • Create all the objects for display 2.

The result would be that each screen would visually have a different theme on it.

If you needed to create more objects after the fact, you could then set the appropriate theme for the display and then create the object on that display.

1 Like

Just a side note:
Be sure LV_THEME_LIVE_UPDATE is 0 else when you call lv_theme_set_current() for the second time the objects with the first theme will be updated to the new theme.

2 Likes

Thank you very much for your reminder.