slint hello world

This commit is contained in:
Jarrod Doyle 2024-04-09 17:01:21 +01:00
commit 1317c37c72
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
6 changed files with 4824 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

4796
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

12
Cargo.toml Normal file
View File

@ -0,0 +1,12 @@
[package]
name = "fmeditor-slint"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
slint = "1.5.1"
[build-dependencies]
slint-build = "1.5.1"

3
build.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
slint_build::compile("ui/appwindow.slint").unwrap();
}

6
src/main.rs Normal file
View File

@ -0,0 +1,6 @@
slint::include_modules!();
fn main() -> Result<(), slint::PlatformError> {
let ui = AppWindow::new()?;
ui.run()
}

6
ui/appwindow.slint Normal file
View File

@ -0,0 +1,6 @@
export component AppWindow inherits Window {
Text {
text: "Hello world!";
color: green;
}
}