How to access/change value of global predefined Palette variable in Rust API ?
#9550
-
|
I want to switch the value of predefined A possible way maybe: let palette = app.global::<Palette>();
palette.set_color_scheme(xxx);but it doesn't work as expected. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
I just tried, I thought I could get it by simply reexporing the Reexport the Palette global: import { Palette } from from "std-widgets.slint";
export { Palette, ColorScheme }Then you can find the palette from the let palette = app.global::<Palette>();So almost there, but this call doesn't work for me as palette.set_color_scheme(ColorScheme::Dark); |
Beta Was this translation helpful? Give feedback.
Yeah, it really works. Thanks!