summaryrefslogtreecommitdiffstats
path: root/views/calendar/qml/View.qml
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-04 14:41:18 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-04 14:42:54 +0200
commit7984ce207450e285ba959502e0caf19f459c1e7a (patch)
treef4f54b39e9f3df448d17f159e852cc99d8cb242d /views/calendar/qml/View.qml
parent2255dd415d9d6858388ccf92561abb3e02d4b5a5 (diff)
downloadkube-7984ce207450e285ba959502e0caf19f459c1e7a.tar.gz
kube-7984ce207450e285ba959502e0caf19f459c1e7a.zip
A date selector
Diffstat (limited to 'views/calendar/qml/View.qml')
-rw-r--r--views/calendar/qml/View.qml73
1 files changed, 43 insertions, 30 deletions
diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml
index 917d0c80..601ca0cf 100644
--- a/views/calendar/qml/View.qml
+++ b/views/calendar/qml/View.qml
@@ -27,6 +27,7 @@ RowLayout {
27 id: root 27 id: root
28 28
29 property date currentDate: new Date() 29 property date currentDate: new Date()
30 property date selectedDate: currentDate
30 property bool autoUpdateDate: true 31 property bool autoUpdateDate: true
31 32
32 Timer { 33 Timer {
@@ -72,12 +73,10 @@ RowLayout {
72 DateView { 73 DateView {
73 date: root.currentDate 74 date: root.currentDate
74 } 75 }
75 color: Kube.Colors.highlightedTextColor 76
76 }
77 }
78 } 77 }
79 78
80 Column { 79 ColumnLayout {
81 anchors { 80 anchors {
82 bottom: parent.bottom 81 bottom: parent.bottom
83 left: newEventButton.left 82 left: newEventButton.left
@@ -85,36 +84,50 @@ RowLayout {
85 bottomMargin: Kube.Units.largeSpacing 84 bottomMargin: Kube.Units.largeSpacing
86 } 85 }
87 86
88 spacing: Kube.Units.smallSpacing 87 spacing: Kube.Units.largeSpacing
89 88
90 Repeater { 89 DateSelector {
91 model: Kube.EntityModel { 90 selectedDate: root.selectedDate
92 type: "calendar" 91 onSelectedDateChanged: {
93 roles: ["name", "color"] 92 root.selectedDate = selectedDate
94 } 93 }
95 delegate: Item { 94 }
96 width: parent.width - Kube.Units.largeSpacing 95
97 height: Kube.Units.gridUnit 96 Column {
98 Row { 97 anchors {
99 spacing: Kube.Units.smallSpacing 98 left: parent.left
100 Kube.CheckBox { 99 right: parent.right
101 opacity: 0.9 100 }
102 checked: true 101 spacing: Kube.Units.smallSpacing
102 Repeater {
103 model: Kube.EntityModel {
104 type: "calendar"
105 roles: ["name", "color"]
106 }
107 delegate: Item {
108 width: parent.width - Kube.Units.largeSpacing
109 height: Kube.Units.gridUnit
110 Row {
111 spacing: Kube.Units.smallSpacing
112 Kube.CheckBox {
113 opacity: 0.9
114 checked: true
115 }
116 Kube.Label {
117 text: model.name
118 color: Kube.Colors.highlightedTextColor
119 }
103 } 120 }
104 Kube.Label { 121 Rectangle {
105 text: model.name 122 anchors.right: parent.right
106 color: Kube.Colors.highlightedTextColor 123 anchors.verticalCenter: parent.verticalCenter
124 width: Kube.Units.gridUnit
125 height: width
126 radius: width / 2
127 color: model.color
128 opacity: 0.9
107 } 129 }
108 } 130 }
109 Rectangle {
110 anchors.right: parent.right
111 anchors.verticalCenter: parent.verticalCenter
112 width: Kube.Units.gridUnit
113 height: width
114 radius: width / 2
115 color: model.color
116 opacity: 0.9
117 }
118 } 131 }
119 } 132 }
120 } 133 }
@@ -123,6 +136,6 @@ RowLayout {
123 WeekView { 136 WeekView {
124 Layout.fillHeight: true 137 Layout.fillHeight: true
125 Layout.fillWidth: true 138 Layout.fillWidth: true
126 currentDate: root.currentDate 139 currentDate: root.selectedDate
127 } 140 }
128} 141}