mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-03 01:53:18 +00:00
Add helpers to setup Selenite in C++ projects
This commit is contained in:
parent
e27b4c150b
commit
f3025d08cd
20 changed files with 24870 additions and 11 deletions
|
@ -1,25 +0,0 @@
|
|||
import { Button, TimePickerPopup, Date, Palette, Time } from "std-widgets.slint";
|
||||
import { VLabeledComponent } from "LabeledComponent.slint";
|
||||
import { VButton } from "Button.slint";
|
||||
|
||||
export component VTimePicker inherits VLabeledComponent {
|
||||
in-out property<Time> time;
|
||||
in-out property<string> timeDisplay: formatZeroPadding(time.hour) + "h" + formatZeroPadding(time.minute);
|
||||
|
||||
pure function formatZeroPadding(number: int) -> string {
|
||||
if (number < 10) {
|
||||
return "0\{number}";
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
button := VButton {
|
||||
text: timeDisplay;
|
||||
enabled: root.enabled;
|
||||
clicked => { timePickerPopup.show() }
|
||||
}
|
||||
|
||||
timePickerPopup := TimePickerPopup {
|
||||
accepted(time) => { root.time = time }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue