Add files settings in UI (wip)

This commit is contained in:
Vyn 2024-04-22 15:45:26 +02:00
parent e5328c15d4
commit d8d50582c3
7 changed files with 92 additions and 35 deletions

View file

@ -15,12 +15,11 @@ import Mirai
ColumnLayout {
id: form
spacing: 6
signal confirmed
signal confirmed(paths: var)
function reset() {
internal.paths = backend.files.map(file => {
return {path: file.path, name: file.name}
})
internal.paths = []
internal.paths = backend.files.map(file => file.path)
}
QtObject {
@ -32,20 +31,25 @@ ColumnLayout {
model: internal.paths
ColumnLayout {
AppLineEdit {
text: modelData.name
text: modelData
onTextChanged: {
internal.paths[index] = text
}
}
}
}
AppLineEdit {
text: modelData.path
}
AppButton {
text: "+"
onClicked: {
internal.paths = [...internal.paths, ""]
}
}
AppButton {
text: "Save"
onClicked: {
backend.
form.confirmed()
form.confirmed(internal.paths)
}
}
}