mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
62 lines
1.3 KiB
QML
62 lines
1.3 KiB
QML
|
/*
|
||
|
* 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.Layouts
|
||
|
import Mirai
|
||
|
|
||
|
ColumnLayout {
|
||
|
|
||
|
AppText {
|
||
|
text: "Tags"
|
||
|
font.pixelSize: 32
|
||
|
}
|
||
|
|
||
|
Item { Layout.preferredHeight: 16 }
|
||
|
|
||
|
Repeater {
|
||
|
model: backend.tags
|
||
|
Rectangle {
|
||
|
Layout.preferredHeight: childrenRect.height
|
||
|
Layout.fillWidth: true
|
||
|
color: backend.activeTagsFilter.includes(modelData) ? MiraiColorPalette.filterSelected : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
|
||
|
radius: 4
|
||
|
AppText {
|
||
|
text: modelData
|
||
|
padding: 4
|
||
|
}
|
||
|
MouseArea {
|
||
|
anchors.fill: parent
|
||
|
onClicked: {
|
||
|
if (backend.activeTagsFilter.includes(modelData)) {
|
||
|
backend.removeTagFilter(modelData)
|
||
|
} else {
|
||
|
backend.addTagFilter(modelData)
|
||
|
}
|
||
|
}
|
||
|
HoverHandler {
|
||
|
id: mouse
|
||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||
|
cursorShape: Qt.PointingHandCursor
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Item {
|
||
|
Layout.fillHeight: true
|
||
|
}
|
||
|
|
||
|
AppButton {
|
||
|
text: `Hide completed tasks: ${backend.shouldHideCompletedTasks ? "ON" : "OFF"}`
|
||
|
onClicked: {
|
||
|
backend.hideCompletedTasks(!backend.shouldHideCompletedTasks)
|
||
|
}
|
||
|
}
|
||
|
}
|