mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Add Source creation/edition + Add missing edit forms for tasks and events
This commit is contained in:
parent
f1ac8a42d1
commit
a15c23bb21
24 changed files with 358 additions and 205 deletions
47
ui/windows/EditSourceWindow.slint
Normal file
47
ui/windows/EditSourceWindow.slint
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue