Polished UI

This commit is contained in:
Maddox Werts 2025-08-01 18:29:02 -04:00
parent 1f85666377
commit d7721b3a8f
2 changed files with 42 additions and 1 deletions

View file

@ -1,4 +1,5 @@
import { DatePickerPopup, Button, VerticalBox, HorizontalBox, ComboBox } from "std-widgets.slint"; import { DatePickerPopup, Button, VerticalBox, HorizontalBox, ComboBox } from "std-widgets.slint";
import { Calculation } from "calculation.slint";
export component Prorater inherits Window { export component Prorater inherits Window {
title: "Auto Spa Express - Prorater"; title: "Auto Spa Express - Prorater";
@ -9,6 +10,7 @@ export component Prorater inherits Window {
out property <string> last_billing: "NULL"; out property <string> last_billing: "NULL";
out property <string> current_membership; out property <string> current_membership;
out property <string> new_membership; out property <string> new_membership;
property <string> calculate_msg: "NULL";
callback on_calculate() -> string; callback on_calculate() -> string;
VerticalBox { VerticalBox {
@ -73,7 +75,8 @@ export component Prorater inherits Window {
Button { Button {
text: "Calculate"; text: "Calculate";
clicked => { clicked => {
result_text.text = on_calculate(); //calculate_msg = on_calculate();
calculation.show();
} }
} }
@ -100,5 +103,11 @@ export component Prorater inherits Window {
date-picker.close(); date-picker.close();
} }
} }
calculation := Calculation {
message: calculate_msg;
x: (root.width - self.width) / 2;
y: (root.height - self.height) / 2;
}
} }
} }

View file

@ -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 <string> 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();
}
}
}
}