generated from OBJNULL/Dockerized-Rust
Polished UI
This commit is contained in:
parent
1f85666377
commit
d7721b3a8f
2 changed files with 42 additions and 1 deletions
|
@ -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 <string> last_billing: "NULL";
|
||||
out property <string> current_membership;
|
||||
out property <string> new_membership;
|
||||
property <string> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
32
project/ui/calculation.slint
Normal file
32
project/ui/calculation.slint
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue