mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
When the slint scale factor is provided at compile time, propagate it also as initial value to the slint::Window created
This commit is contained in:
parent
360f192b91
commit
fb6775b386
5 changed files with 47 additions and 24 deletions
|
@ -117,7 +117,8 @@ pub struct CompilerConfiguration {
|
|||
pub inline_all_elements: bool,
|
||||
|
||||
/// Compile time scale factor to apply to embedded resources such as images and glyphs.
|
||||
pub scale_factor: f64,
|
||||
/// If != 1.0 then the scale factor will be set on the `slint::Window`.
|
||||
pub const_scale_factor: f64,
|
||||
|
||||
/// expose the accessible role and properties
|
||||
pub accessibility: bool,
|
||||
|
@ -176,7 +177,7 @@ impl CompilerConfiguration {
|
|||
Err(_) => output_format == OutputFormat::Interpreter,
|
||||
};
|
||||
|
||||
let scale_factor = std::env::var("SLINT_SCALE_FACTOR")
|
||||
let const_scale_factor = std::env::var("SLINT_SCALE_FACTOR")
|
||||
.ok()
|
||||
.and_then(|x| x.parse::<f64>().ok())
|
||||
.filter(|f| *f > 0.)
|
||||
|
@ -206,7 +207,7 @@ impl CompilerConfiguration {
|
|||
open_import_fallback: None,
|
||||
resource_url_mapper: None,
|
||||
inline_all_elements,
|
||||
scale_factor,
|
||||
const_scale_factor,
|
||||
accessibility: true,
|
||||
enable_experimental,
|
||||
translation_domain: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue