Review function

This commit is contained in:
Alexey 2025-09-11 13:58:17 +03:00
commit bb230ab4dc
3 changed files with 50 additions and 18 deletions

View file

@ -1,4 +1,4 @@
import { VerticalBox, LineEdit, Button, DatePickerPopup, ComboBox } from "std-widgets.slint";
import { VerticalBox, LineEdit, Button, DatePickerPopup, ComboBox, Slider } from "std-widgets.slint";
import { Timeline } from "timeline.slint";
export component ReviewWidget inherits VerticalBox {
@ -16,44 +16,44 @@ export component ReviewWidget inherits VerticalBox {
tl := Timeline {
updating: false;
TouchArea {
preferred-width: 100%;
preferred-height: 100%;
moved => {
if self.pressed {
root.offset -= (self.mouse-x - self.pressed-x) / 1px;
root.offset = clamp(root.offset, visible-time, max-offset);
}
}
}
}
GridLayout {
spacing-vertical: 8px;
spacing-horizontal: 16px;
Slider {
minimum: visible-time;
maximum: 24 * 3600;
value: offset;
row: 0;
colspan: 2;
changed(value) => {
offset = value;
}
}
Text {
text: "Day: \{current-day}/\{current-month}/\{current-year}";
font-size: 32px;
horizontal-alignment: right;
row: 0;
row: 1;
}
Button {
text: "Select";
clicked => {
date-picker.show()
}
row: 0;
row: 1;
col: 1;
}
Text {
text: "Span: ";
font-size: 24px;
row: 1;
row: 2;
horizontal-alignment: right;
}
ComboBox {
model: combo-spans;
current-index: 0;
row: 1;
row: 2;
col: 1;
selected(current-value) => {
root.update-visible-time(current-value);