Add Source creation/edition + Add missing edit forms for tasks and events

This commit is contained in:
Vyn 2024-11-01 13:43:45 +01:00
parent f1ac8a42d1
commit a15c23bb21
24 changed files with 358 additions and 205 deletions

View file

@ -1,13 +1,15 @@
import { Backend, TaskData } from "../Backend.slint";
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
import { Button, VerticalBox, CheckBox, Date, ScrollView, ComboBox } from "std-widgets.slint";
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VTag, VText, VTextInput, Svg, Palette } from "@selenite";
import { NewTaskData, SaveTaskData } from "../Backend.slint";
export component TaskEdit inherits VerticalLayout {
in-out property <SaveTaskData> task;
in-out property <TaskData> task;
out property <bool> should-show;
public function show(task: SaveTaskData) {
private property <Date> newDate: task.date;
public function show(task: TaskData) {
root.task = task;
should-show = true;
}
@ -16,8 +18,6 @@ export component TaskEdit inherits VerticalLayout {
}
callback accepted(SaveTaskData);
if !should-show : Rectangle {}
if should-show : Rectangle {
@ -26,8 +26,8 @@ export component TaskEdit inherits VerticalLayout {
id: task.id,
sourceId: task.sourceId,
title: newTaskTitleInput.text,
scheduled: taskDateInput.date.year != 0,
date: taskDateInput.date
scheduled: newDate.year != 0,
date: newDate
});
}
background: Palette.background;
@ -43,9 +43,10 @@ export component TaskEdit inherits VerticalLayout {
HorizontalLayout {
alignment: start;
spacing: 8px;
taskDateInput := VDatePicker {
if root.task.eventId == -1 : taskDateInput := VDatePicker {
date: task.date;
enabled: true;
edited(date) => { newDate = date; }
}
VButton {
text: "Modify";