feat: Added light and dark features
- Updated slint to 1.15.1
This commit is contained in:
parent
d4e924b258
commit
d08e172f34
3 changed files with 1621 additions and 1103 deletions
2730
Cargo.lock
generated
2730
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
10
Cargo.toml
10
Cargo.toml
|
|
@ -3,16 +3,18 @@ name = "aliveline"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4.42"
|
chrono = "0.4.42"
|
||||||
serde = "1.0.219"
|
serde = "1.0.219"
|
||||||
slint = "1.12.1"
|
slint = "1.15.1"
|
||||||
toml = "0.9.5"
|
toml = "0.9.5"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
slint-build = "1.12.1"
|
slint-build = "1.15.1"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
||||||
|
[features]
|
||||||
|
light = []
|
||||||
|
dark = []
|
||||||
|
|
|
||||||
14
build.rs
14
build.rs
|
|
@ -1,6 +1,18 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
||||||
|
let mut style = String::from("cosmic");
|
||||||
|
|
||||||
|
#[cfg(all(feature = "dark", feature = "light"))]
|
||||||
|
compile_error!("Features \"dark\" and \"light\" are mutually exclusive");
|
||||||
|
|
||||||
|
if cfg!(feature = "dark") {
|
||||||
|
style.push_str("-dark");
|
||||||
|
} else if cfg!(feature = "light") {
|
||||||
|
style.push_str("-light");
|
||||||
|
}
|
||||||
|
|
||||||
let config = slint_build::CompilerConfiguration::new()
|
let config = slint_build::CompilerConfiguration::new()
|
||||||
.with_style("cosmic".into());
|
.with_style(style);
|
||||||
|
|
||||||
slint_build::compile_with_config("ui/app-window.slint", config).expect("Slint build failed");
|
slint_build::compile_with_config("ui/app-window.slint", config).expect("Slint build failed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue