slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 567 forks source link

[Slint ver 1.0.1] CompilerConfiguration does not change the rendering style to "material" #2610

Closed volodg closed 1 year ago

volodg commented 1 year ago

Given code does not work anynore:

let config = slint_build::CompilerConfiguration::new().with_style("material".into()); slint_build::compile_with_config("ui/app.slint", config).unwrap();

OS: MacOS

ogoffart commented 1 year ago

Thanks for reporting a bug.

Could you elaborate what is not working exactly? What is the error. Thanks

volodg commented 1 year ago

No errors, style just does change to "material", and default one is displayed

ogoffart commented 1 year ago

This works for me. If i change our gallery example to use the "material" style using lines similar to that, it does change to the material style. Is it a regression from 1.0.0?

volodg commented 1 year ago

This app was looking like that with version 1.0.0 (I have no screen shot for MacOS now but it was the same) image

And with 1.0.1:

Screenshot 2023-04-21 at 10 50 10

The magic is, downgrading version does not help ((

Source code: https://github.com/biotech-ng/exchange/blob/main/slint/src/main.rs

ogoffart commented 1 year ago

Thanks for the screenshots. Both are showing the material theme. One is showing the light theme, and the other is showing the dark theme.

Something happened that made it detect a different dark mode.

You can force the light mode by using "material-light":

let config = slint_build::CompilerConfiguration::new().with_style("material-light".into());

But is your desktop in dark mode or not?
Maybe somehow the style detection was either fixed, or broken. (Possibly because dependency upgrades)

volodg commented 1 year ago

I have a dark style in MacOS, right, so seems it was not broken but fixed in 1.0.1, now with the style: "material-light" it works as expected, thanks for your advise. Closing an issue