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

@ -0,0 +1,47 @@
import { Backend } from "../Backend.slint";
import { VerticalBox, CheckBox } from "std-widgets.slint";
import { SideBar } from "../components/SideBar.slint";
import { VButton, VText, VTextInput, Palette } from "@selenite";
export component EditSourceWindow inherits Window {
in-out property <int> id;
in-out property name <=> nameInput.text;
in-out property path <=> pathInput.text;
title: "Mirai - Edit source";
min-height: 100px;
max-height: 4000px; // needed, otherwise the window wants to fit the content (on Swaywm)
min-width: 400px;
default-font-size: 16px;
background: Palette.background;
VerticalLayout {
padding: 16px;
spacing: 8px;
nameInput := VTextInput {
label: "Name";
}
pathInput := VTextInput {
label: "Path";
}
VButton {
text: "Save";
clicked => {
Backend.modify-source({
id: root.id,
name: nameInput.text,
path: pathInput.text
})
}
}
VButton {
text: "Delete";
background-color: Colors.red;
double-clicked => {
Backend.delete-source(root.id)
}
}
}
}
export { Backend, Palette } // Export to make it visible to the C++ backend