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; in-out property default-source-path; VerticalLayout { padding: 16px; spacing: 8px; nameInput := VTextInput { label: "Name"; text: "todo"; } pathInput := VTextInput { label: "Path"; text: root.default-source-path + nameInput.text + ".md"; } 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