Tags are now visible on each task

This commit is contained in:
Vyn 2024-04-11 13:29:40 +02:00
parent bae67e6851
commit 839109b77b
6 changed files with 54 additions and 2 deletions

View file

@ -7,7 +7,6 @@
import QtQuick
import QtQuick.Window
import QtQuick.Layouts
import QtQuick.Controls
import Mirai
RowLayout {
@ -24,4 +23,16 @@ RowLayout {
backend.updateTodo(index, modelData.state === 'DONE' ? "TODO" : "DONE", modelData.text, modelData.date)
}
}
Repeater {
model: task.tags
Tag {
Layout.alignment: Qt.AlignVCenter
text: modelData
backgroundColor: colorPalette.selected.fieldBackground
textColor: colorPalette.selected.palette.sapphire
}
}
}

View file

@ -0,0 +1,28 @@
/*
* 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 Mirai
Rectangle {
id: control
property string text
property string backgroundColor
property string textColor
color: backgroundColor
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
radius: 8
AppText {
color: control.textColor
padding: 2
leftPadding: 6
rightPadding: 6
text: control.text
}
}