Add Unscheduled tasks

This commit is contained in:
Vyn 2024-10-08 16:36:01 +02:00
parent 07081bb27b
commit 53b1280115
13 changed files with 134 additions and 12 deletions

View file

@ -1,11 +1,12 @@
import { Date, ComboBox } from "std-widgets.slint";
import { VTextInput, VButton, VDatePicker, VText, Palette } from "@vynui";
import { VTextInput, VButton, VDatePicker, VText, VCheckBox, Palette } from "@vynui";
import { Backend } from "../Backend.slint";
export struct NewTaskData {
sourceId: int,
eventId: int,
title: string,
scheduled: bool,
date: Date
}
@ -13,6 +14,7 @@ export struct SaveTaskData {
sourceId: int,
id: int,
title: string,
scheduled: bool,
date: Date,
}
@ -28,6 +30,7 @@ export component TaskWindow inherits Window {
in-out property<int> taskId: -1;
in-out property<int> eventId: -1;
in-out property<bool> scheduled <=> scheduledInput.checked;
in-out property<Date> taskDate <=> taskDateInput.date;
in-out property<string> taskTitle <=> taskTitleInput.text;
in-out property<int> taskSourceIndex <=> sourceInput.current-index;
@ -53,9 +56,13 @@ export component TaskWindow inherits Window {
accepted => { button.clicked() }
}
scheduledInput := VCheckBox {
text: "Scheduled";
}
taskDateInput := VDatePicker {
label: "Date";
enabled: eventId == -1;
enabled: eventId == -1 && scheduledInput.checked;
}
button := VButton {
@ -66,6 +73,7 @@ export component TaskWindow inherits Window {
sourceId: taskSourceIndex,
eventId: eventId,
title: taskTitle,
scheduled: scheduled,
date: taskDate,
});
} else {
@ -73,6 +81,7 @@ export component TaskWindow inherits Window {
sourceId: taskSourceIndex,
id: taskId,
title: taskTitle,
scheduled: scheduled,
date: taskDate,
});
}