diff --git a/src/Backend.cpp b/src/Backend.cpp index 9f8a0d9..26bdde1 100644 --- a/src/Backend.cpp +++ b/src/Backend.cpp @@ -243,5 +243,8 @@ QVariant Backend::getFiles() QString Backend::getTagColor(QString tag) { + if (!tagsConfig.contains(tag)) { + return "#c6d0f5"; // TODO: currently hard coded but should match the default Text color. + } return tagsConfig[tag]; } diff --git a/src/qml/components/Calendar.qml b/src/qml/components/Calendar.qml index 9f15ea0..5209ef7 100644 --- a/src/qml/components/Calendar.qml +++ b/src/qml/components/Calendar.qml @@ -138,14 +138,20 @@ ColumnLayout { property string name: modelData.text property int startTime: parseInt(modelData.startTime) property int endTime: parseInt(modelData.endTime) - color: colorPalette.selected.calendarEvent + color: colorPalette.selected.palette.surface0 anchors.right: parent.right anchors.left: parent.left anchors.rightMargin: 2 anchors.leftMargin: 2 radius: 4 y: daysSurface.hourHeight * startTime - height: (endTime - startTime) * daysSurface.hourHeight + height: (endTime - startTime) * daysSurface.hourHeight - 4 + + Rectangle { + anchors.fill: parent + color: backend.getTagColor(modelData.tags[0]) + opacity: 0.2 + } Rectangle { color: backend.getTagColor(modelData.tags[0]) @@ -162,9 +168,12 @@ ColumnLayout { anchors.margins: 8 anchors.leftMargin: 12 AppText { + color: backend.getTagColor(modelData.tags[0]) + Layout.fillWidth: true + Layout.fillHeight: true text: name + wrapMode: Text.Wrap } - Item { Layout.fillHeight: true } } } }