From 064367aec304708591f5cd4d010ed462119a0323 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 3 Aug 2018 10:46:12 +0200 Subject: Calendar color indicator --- views/calendar/qml/View.qml | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'views/calendar/qml') diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml index d5f26505..2a819ab6 100644 --- a/views/calendar/qml/View.qml +++ b/views/calendar/qml/View.qml @@ -97,6 +97,7 @@ RowLayout { anchors { bottom: parent.bottom left: newEventButton.left + right: parent.right bottomMargin: Kube.Units.largeSpacing } @@ -105,17 +106,30 @@ RowLayout { Repeater { model: Kube.EntityModel { type: "calendar" - roles: ["name"] + roles: ["name", "color"] } - delegate: Row { - spacing: Kube.Units.smallSpacing - Kube.CheckBox { - opacity: 0.9 - checked: true + delegate: Item { + width: parent.width - Kube.Units.largeSpacing + height: Kube.Units.gridUnit + Row { + spacing: Kube.Units.smallSpacing + Kube.CheckBox { + opacity: 0.9 + checked: true + } + Kube.Label { + text: model.name + color: Kube.Colors.highlightedTextColor + } } - Kube.Label { - text: model.name - color: Kube.Colors.highlightedTextColor + Rectangle { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + width: Kube.Units.gridUnit + height: width + radius: width / 2 + color: model.color + opacity: 0.9 } } } -- cgit v1.2.3