Support multiple files

This commit is contained in:
Vyn 2024-04-14 14:11:41 +02:00
parent f8f49233dc
commit 689eea07a7
22 changed files with 528 additions and 131 deletions

View file

@ -11,6 +11,45 @@ import Mirai
ColumnLayout {
AppText {
text: "Files"
font.pixelSize: 32
}
Item { Layout.preferredHeight: 16 }
Repeater {
model: backend.files
Rectangle {
Layout.preferredHeight: childrenRect.height
Layout.fillWidth: true
color: backend.activeFilesFilter.includes(modelData.name) ? MiraiColorPalette.filterSelected : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
radius: 4
AppText {
text: modelData.name
padding: 4
}
MouseArea {
anchors.fill: parent
onClicked: {
if (backend.activeFilesFilter.includes(modelData.name)) {
backend.removeFileFilter(modelData.name)
} else {
backend.addFileFilter(modelData.name)
}
}
HoverHandler {
id: mouse
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
cursorShape: Qt.PointingHandCursor
}
}
}
}
Item { Layout.preferredHeight: 16 }
AppText {
text: "Tags"
font.pixelSize: 32
@ -58,4 +97,11 @@ ColumnLayout {
backend.hideCompletedTasks(!backend.shouldHideCompletedTasks)
}
}
/*AppButton {
text: `Settings`
onClicked: {
root.openSettings()
}
}*/
}