mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
37 lines
912 B
Text
37 lines
912 B
Text
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 AddSourceWindow inherits Window {
|
|
|
|
title: "Mirai - Add 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: "Create";
|
|
clicked => {
|
|
Backend.add-source({
|
|
name: nameInput.text,
|
|
type: "FileSystemMarkdown",
|
|
path: pathInput.text
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export { Backend, Palette } // Export to make it visible to the C++ backend
|