eclipsesource / tabris-js

Create native mobile apps in JavaScript or TypeScript.
https://tabrisjs.com
BSD 3-Clause "New" or "Revised" License
1.4k stars 170 forks source link

Allow to theme widget with a default color set #1991

Open mpost opened 4 years ago

mpost commented 4 years ago

Problem description

At the moment all widgets have the platform specific theme.

Expected behavior

It should be possible to style all Widget uniformly.

Environment

fax1ty commented 4 years ago

@mpost It would be very convenient if there was a mechanism that allows you to change the theme of the entire application on the fly. For example, this would be useful for quickly creating a night mode. Something like a global styleManager object that would have a collection of colors. styleManager.colors.main // '#000' or '#fff'

There would be a .setTheme method setTheme(themeName: string): void; After executing this function, all widgets that use the values of this object would change these values.

mpost commented 4 years ago

We are thinking in that direct as well. Be aware though that not all parts of a mobile app can be styled at runtime.

cookieguru commented 4 years ago

@fax1ty I think #1932 would be better for night mode

fax1ty commented 4 years ago

@cookieguru 1) Still no event about changing darkMode 2) At the moment, Tabris doesn't have a native app styling tool. I just described how I program the night mode. I would like to see about the same thing but more natively.

tbuschto commented 4 years ago

In the first iteration the theme will not be dynamic, meaning changing it after a widget is intanciated will not change the existing widget. That may be a feature for 3.5, but not 3.4.