mirai/src/qml/forms/FilesForm.qml

57 lines
898 B
QML
Raw Normal View History

2024-04-14 14:11:41 +02:00
/*
* Mirai. Copyright (C) 2024 Vyn
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
*/
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
import Mirai
// WIP
ColumnLayout {
id: form
spacing: 6
2024-04-22 15:45:26 +02:00
signal confirmed(paths: var)
2024-04-14 14:11:41 +02:00
function reset() {
2024-04-22 15:45:26 +02:00
internal.paths = []
internal.paths = backend.files.map(file => file.path)
2024-04-14 14:11:41 +02:00
}
QtObject {
id: internal
property var paths
}
Repeater {
model: internal.paths
ColumnLayout {
AppLineEdit {
2024-04-22 15:45:26 +02:00
text: modelData
onTextChanged: {
internal.paths[index] = text
}
2024-04-14 14:11:41 +02:00
}
2024-04-22 15:45:26 +02:00
}
}
2024-04-14 14:11:41 +02:00
2024-04-22 15:45:26 +02:00
AppButton {
text: "+"
onClicked: {
internal.paths = [...internal.paths, ""]
2024-04-14 14:11:41 +02:00
}
}
AppButton {
text: "Save"
onClicked: {
2024-04-22 15:45:26 +02:00
form.confirmed(internal.paths)
2024-04-14 14:11:41 +02:00
}
}
}