mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 09:23:18 +00:00
Add more color to Calendar events
This commit is contained in:
parent
d27cf89eee
commit
01037b1717
2 changed files with 15 additions and 3 deletions
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue