Skip to main content
VSimu.1
Associate III
October 6, 2020
Solved

How best to implement 2 UIs: light-theme and dark-theme?

  • October 6, 2020
  • 1 reply
  • 860 views

Hello,

We have a final design for our UI, with all of the elements and widgets decided.

We would like to be able to make the color of the Application light-themed and dark-themed (similar to how in a source code editor, you can have a light-theme and dark-theme).

We would like to be able to change the theme during run-time, so that the customer can select which color option is best for them.

Is there a built-in way of doing this? The only ideas we have is either:

1) Deciding in the constructor of each Screen View, which color the Texts, Widgets, etc shall be, as well as which background images to load.

2) Creating a light-themed screen and a dark-themed screen for everything (which makes maintenance awfully tedious and difficult.

This topic has been closed for replies.
Best answer by Alexandre RENOUX

Hello,

You save the value of your variable (e.g. light-theme = 0 and dark-theme = 1) in the Model and then in every setupScreen() function you check the value and set all your widgets on the selected screen accordingly.

/Alexandre

1 reply

Alexandre RENOUX
Alexandre RENOUXBest answer
Visitor II
October 8, 2020

Hello,

You save the value of your variable (e.g. light-theme = 0 and dark-theme = 1) in the Model and then in every setupScreen() function you check the value and set all your widgets on the selected screen accordingly.

/Alexandre