Add helpers to setup Selenite in C++ projects

This commit is contained in:
Vyn 2024-10-27 22:03:20 +01:00
parent e27b4c150b
commit f3025d08cd
20 changed files with 24870 additions and 11 deletions

View file

@ -1,48 +0,0 @@
import { Button, DatePickerPopup, Date, Palette } from "std-widgets.slint";
import { VLabeledComponent } from "LabeledComponent.slint";
import { VActionButton } from "ActionButton.slint";
import { VButton } from "Button.slint";
import { Svg } from "Svg.slint";
export component VDatePicker inherits VLabeledComponent {
in-out property<Date> date;
in-out property<string> dateDisplay;
pure function formatZeroPadding(number: int) -> string {
if (number < 10) {
return "0\{number}";
}
return number;
}
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: Svg.reset;
icon-svg-stroke-width: 1px;
enabled: root.enabled;
clicked => { resetDate() }
}
}
taskDateInput := DatePickerPopup {
accepted(date) => { root.date = date }
}
}