From d83c5a0acac5e291dac91439a73d8247d960de18 Mon Sep 17 00:00:00 2001 From: Candifloss Date: Wed, 15 Oct 2025 22:56:26 +0530 Subject: [PATCH] Begin Slint UI - Get started with Slint for UI - Experiment with basic window structure --- widget/Cargo.toml | 4 ++++ widget/ui/widget-popup.slint | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 widget/ui/widget-popup.slint diff --git a/widget/Cargo.toml b/widget/Cargo.toml index e3f2820..6caf859 100644 --- a/widget/Cargo.toml +++ b/widget/Cargo.toml @@ -10,3 +10,7 @@ reqwest = {version = "0.12.23", features = ["blocking", "json"] } toml = "0.9.7" dirs = "6.0.0" serde_json = "1.0.145" +slint = "1.13" + +[build-dependencies] +slint-build = "1.13.1" \ No newline at end of file diff --git a/widget/ui/widget-popup.slint b/widget/ui/widget-popup.slint new file mode 100644 index 0000000..6da190f --- /dev/null +++ b/widget/ui/widget-popup.slint @@ -0,0 +1,41 @@ +export component MainWindow inherits Window { + always-on-top: true; + height: 100px; + width: 300px; + no-frame: true; + + weather_popup := Rectangle { + height: 100%; + width: 100%; + border-radius: 10px; + border-color: #ffffff00; + background: #7e7e7e36; + + main_temp := Text {text: "24.4" + "°C"; + vertical-alignment: TextVerticalAlignment.center; + x: 10px; + y: 10px; + color: #ffffff; + font-family: "IosevkaTermSlab Nerd Font Mono"; + font-size: 40px; + } + + weather_summary := Text { + text: "Clear"; + x: 10px; + y: 55px; + font-size: 30px; + font-family: "IosevkaTermSlab Nerd Font Mono"; + color: #fff; + } + + city_name := Text { + text: "England"; + x: 150px; + y: 55px; + font-size: 25px; + font-family: "IosevkaTermSlab Nerd Font Mono"; + color: #fff; + } + } +} \ No newline at end of file