Ui changes, remove unused buttons

This commit is contained in:
Vyn 2024-10-15 11:55:39 +02:00
parent 36a2fe9220
commit e28ba796cd
53 changed files with 133 additions and 27125 deletions

View file

@ -1,12 +1,11 @@
import { Button, DatePickerPopup, Date, Palette } from "std-widgets.slint";
import { VLabeledComponent } from "LabeledComponent.slint";
import { VActionButton } from "ActionButton.slint";
import { VButton } from "Button.slint";
export component VDatePicker inherits VLabeledComponent {
in-out property<Date> date;
in-out property<string> dateDisplay: formatZeroPadding(date.day) + "/" + formatZeroPadding(date.month) + "/" + date.year;
in-out property<string> dateDisplay;
pure function formatZeroPadding(number: int) -> string {
if (number < 10) {
@ -15,10 +14,31 @@ export component VDatePicker inherits VLabeledComponent {
return number;
}
button := VButton {
text: dateDisplay;
enabled: root.enabled;
clicked => { taskDateInput.show() }
pure function getDateDisplay() -> string {
if (date.year == 0) {
return "Unscheduled";
}
return formatZeroPadding(date.day) + "/" + formatZeroPadding(date.month) + "/" + date.year;
}
function resetDate() {
date.year = 0;
date.month = 0;
date.day = 0;
}
HorizontalLayout {
VButton {
text: getDateDisplay();
enabled: root.enabled;
clicked => { taskDateInput.show() }
}
VActionButton {
icon-svg: "M18 28A12 12 0 1 0 6 16v6.2l-3.6-3.6L1 20l6 6l6-6l-1.4-1.4L8 22.2V16a10 10 0 1 1 10 10Z";
icon-svg-stroke-width: 1px;
enabled: root.enabled;
clicked => { resetDate() }
}
}
taskDateInput := DatePickerPopup {