summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-03 10:46:12 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-03 10:46:12 +0200
commit064367aec304708591f5cd4d010ed462119a0323 (patch)
tree6f756cf6a368dd8868f14c37cc7f6d09101f3786
parentcd1c28cd7a1631f99d6a6efa1b74180d82c76cc3 (diff)
downloadkube-064367aec304708591f5cd4d010ed462119a0323.tar.gz
kube-064367aec304708591f5cd4d010ed462119a0323.zip
Calendar color indicator
-rw-r--r--views/calendar/main.qml7
-rw-r--r--views/calendar/qml/View.qml32
2 files changed, 30 insertions, 9 deletions
diff --git a/views/calendar/main.qml b/views/calendar/main.qml
index 07ee6302..1e7e8eac 100644
--- a/views/calendar/main.qml
+++ b/views/calendar/main.qml
@@ -49,6 +49,7 @@ ApplicationWindow {
49 id: "calendar1", 49 id: "calendar1",
50 resource: "caldavresource", 50 resource: "caldavresource",
51 name: "Test Calendar", 51 name: "Test Calendar",
52 color: "#af1a6a",
52 events: [ 53 events: [
53 { 54 {
54 resource: "caldavresource", 55 resource: "caldavresource",
@@ -136,6 +137,12 @@ ApplicationWindow {
136 allDay: true, 137 allDay: true,
137 }, 138 },
138 ], 139 ],
140 },
141 {
142 id: "calendar2",
143 resource: "caldavresource",
144 name: "Test Calendar2",
145 color: "#f67400"
139 }], 146 }],
140 } 147 }
141 TestStore.setup(initialState) 148 TestStore.setup(initialState)
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 {
97 anchors { 97 anchors {
98 bottom: parent.bottom 98 bottom: parent.bottom
99 left: newEventButton.left 99 left: newEventButton.left
100 right: parent.right
100 bottomMargin: Kube.Units.largeSpacing 101 bottomMargin: Kube.Units.largeSpacing
101 } 102 }
102 103
@@ -105,17 +106,30 @@ RowLayout {
105 Repeater { 106 Repeater {
106 model: Kube.EntityModel { 107 model: Kube.EntityModel {
107 type: "calendar" 108 type: "calendar"
108 roles: ["name"] 109 roles: ["name", "color"]
109 } 110 }
110 delegate: Row { 111 delegate: Item {
111 spacing: Kube.Units.smallSpacing 112 width: parent.width - Kube.Units.largeSpacing
112 Kube.CheckBox { 113 height: Kube.Units.gridUnit
113 opacity: 0.9 114 Row {
114 checked: true 115 spacing: Kube.Units.smallSpacing
116 Kube.CheckBox {
117 opacity: 0.9
118 checked: true
119 }
120 Kube.Label {
121 text: model.name
122 color: Kube.Colors.highlightedTextColor
123 }
115 } 124 }
116 Kube.Label { 125 Rectangle {
117 text: model.name 126 anchors.right: parent.right
118 color: Kube.Colors.highlightedTextColor 127 anchors.verticalCenter: parent.verticalCenter
128 width: Kube.Units.gridUnit
129 height: width
130 radius: width / 2
131 color: model.color
132 opacity: 0.9
119 } 133 }
120 } 134 }
121 } 135 }