mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Allow checking at runtime about the current theme (#8049)
Although std-widgets provides many properties that adapt to the current theme users who would like to go beyond these properties and do theme dependent changes are limited. One option would be to add even more properties to the Palette, however this would potentially bloat the object, it's not obvious what properties users care about and this approach doesn't scale. In many cases developers could simply create their own properties if they knew what the current runtime theme was. This simple change allows an app to know what the current theme is and present theme appropriate UI's.
This commit is contained in:
parent
d185333165
commit
538f8bde19
6 changed files with 36 additions and 0 deletions
|
@ -22,6 +22,7 @@ export global StyleMetrics {
|
|||
}
|
||||
|
||||
export global Palette {
|
||||
out property <string> style-name: "fluent";
|
||||
out property <brush> background: FluentPalette.background;
|
||||
out property <brush> foreground: FluentPalette.foreground;
|
||||
out property <brush> alternate-background: FluentPalette.alternate-background;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue