mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Rust: defaults to the native
style when Qt is available
This requires some gymnastics to get right as the information need to be passed to the compiler despite having no direct dependency between the compiler and the runtime or backends. So use a file in the build directory to tell the default style cc: #83
This commit is contained in:
parent
3d1c71b762
commit
7821926002
7 changed files with 82 additions and 0 deletions
|
@ -340,6 +340,13 @@ pub fn sixtyfps(stream: TokenStream) -> TokenStream {
|
|||
//println!("{:#?}", syntax_node);
|
||||
let mut compiler_config =
|
||||
CompilerConfiguration::new(sixtyfps_compilerlib::generator::OutputFormat::Rust);
|
||||
|
||||
if std::env::var_os("SIXTYFPS_STYLE").is_none() {
|
||||
compiler_config.style = std::fs::read_to_string(env!("SIXTYFPS_DEFAULT_STYLE_PATH"))
|
||||
.map(|style| style.trim().into())
|
||||
.ok()
|
||||
}
|
||||
|
||||
compiler_config.include_paths = include_paths;
|
||||
let (root_component, mut diag) =
|
||||
spin_on::spin_on(compile_syntax_node(syntax_node, diag, compiler_config));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue