From d7721b3a8feac1c18af5e8bc428dd7994bbdb138 Mon Sep 17 00:00:00 2001 From: Maddox Werts Date: Fri, 1 Aug 2025 18:29:02 -0400 Subject: [PATCH] Polished UI --- project/ui/app.slint | 11 ++++++++++- project/ui/calculation.slint | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 project/ui/calculation.slint diff --git a/project/ui/app.slint b/project/ui/app.slint index 04f32ca..3c846f2 100644 --- a/project/ui/app.slint +++ b/project/ui/app.slint @@ -1,4 +1,5 @@ import { DatePickerPopup, Button, VerticalBox, HorizontalBox, ComboBox } from "std-widgets.slint"; +import { Calculation } from "calculation.slint"; export component Prorater inherits Window { title: "Auto Spa Express - Prorater"; @@ -9,6 +10,7 @@ export component Prorater inherits Window { out property last_billing: "NULL"; out property current_membership; out property new_membership; + property calculate_msg: "NULL"; callback on_calculate() -> string; VerticalBox { @@ -73,7 +75,8 @@ export component Prorater inherits Window { Button { text: "Calculate"; clicked => { - result_text.text = on_calculate(); + //calculate_msg = on_calculate(); + calculation.show(); } } @@ -100,5 +103,11 @@ export component Prorater inherits Window { date-picker.close(); } } + + calculation := Calculation { + message: calculate_msg; + x: (root.width - self.width) / 2; + y: (root.height - self.height) / 2; + } } } diff --git a/project/ui/calculation.slint b/project/ui/calculation.slint new file mode 100644 index 0000000..1b1fb38 --- /dev/null +++ b/project/ui/calculation.slint @@ -0,0 +1,32 @@ +import { VerticalBox, Button } from "std-widgets.slint"; + +export component Calculation inherits PopupWindow { + width: 400px; + height: 200px; + close-policy: PopupClosePolicy.no-auto-close; + + in property message: "EXAMPLE MESSAGE"; + + Rectangle { + height: 100%; + width: 100%; + background: lightgray; + } + + VerticalBox { + Text { + text: message; + font-size: 1.5rem; + horizontal-alignment: center; + vertical-alignment: center; + } + + Button { + text: "Dismiss"; + height: 50px; + clicked => { + root.close(); + } + } + } +}