summaryrefslogtreecommitdiffstats
path: root/views/calendar/qml/View.qml
diff options
context:
space:
mode:
Diffstat (limited to 'views/calendar/qml/View.qml')
-rw-r--r--views/calendar/qml/View.qml112
1 files changed, 58 insertions, 54 deletions
diff --git a/views/calendar/qml/View.qml b/views/calendar/qml/View.qml
index 0ef87e65..3aa1398d 100644
--- a/views/calendar/qml/View.qml
+++ b/views/calendar/qml/View.qml
@@ -59,48 +59,52 @@ RowLayout {
59 } 59 }
60 60
61 Rectangle { 61 Rectangle {
62 anchors {
63 top: parent.top
64 bottom: parent.bottom
65 }
62 width: Kube.Units.gridUnit * 10 66 width: Kube.Units.gridUnit * 10
63 Layout.fillHeight: parent.height
64 color: Kube.Colors.darkBackgroundColor 67 color: Kube.Colors.darkBackgroundColor
65 68
66 Kube.PositiveButton { 69 Column {
67 id: newEventButton 70 id: topLayout
68 objectName: "newEventButton"
69
70 anchors { 71 anchors {
71 top: parent.top 72 top: parent.top
72 left: parent.left 73 left: parent.left
73 right: parent.right 74 right: parent.right
74 margins: Kube.Units.largeSpacing 75 margins: Kube.Units.largeSpacing
75 } 76 }
76 focus: true 77 Kube.PositiveButton {
77 text: qsTr("New Event") 78 id: newEventButton
78 onClicked: {} 79 objectName: "newEventButton"
79 }
80 80
81 Column { 81 anchors {
82 anchors { 82 left: parent.left
83 top: newEventButton.bottom 83 right: parent.right
84 left: newEventButton.left 84 }
85 topMargin: Kube.Units.largeSpacing 85 focus: true
86 text: qsTr("New Event")
87 onClicked: {}
86 } 88 }
87
88 width: parent.width
89 spacing: Kube.Units.smallSpacing
90
91 DateView { 89 DateView {
90 anchors {
91 left: parent.left
92 right: parent.right
93 }
92 date: root.currentDate 94 date: root.currentDate
93 } 95 }
94
95 } 96 }
96 97
97 ColumnLayout { 98 ColumnLayout {
99 //Grow from the button but don't go over topLayout
98 anchors { 100 anchors {
99 bottom: parent.bottom 101 bottom: parent.bottom
100 left: newEventButton.left 102 left: topLayout.left
101 right: parent.right 103 right: parent.right
102 bottomMargin: Kube.Units.largeSpacing 104 bottomMargin: Kube.Units.largeSpacing
105 rightMargin: Kube.Units.largeSpacing
103 } 106 }
107 height: Math.min(implicitHeight, parent.height - (topLayout.y + topLayout.height) - Kube.Units.largeSpacing)
104 108
105 spacing: Kube.Units.largeSpacing 109 spacing: Kube.Units.largeSpacing
106 110
@@ -109,7 +113,6 @@ RowLayout {
109 anchors { 113 anchors {
110 left: parent.left 114 left: parent.left
111 right: parent.right 115 right: parent.right
112 rightMargin: Kube.Units.largeSpacing
113 } 116 }
114 selectedDate: root.selectedDate 117 selectedDate: root.selectedDate
115 onSelectedDateChanged: { 118 onSelectedDateChanged: {
@@ -118,44 +121,45 @@ RowLayout {
118 } 121 }
119 } 122 }
120 123
121 Column { 124 Kube.ListView {
125 Layout.fillHeight: true
126 Layout.preferredHeight: contentHeight
127 Layout.minimumHeight: Kube.Units.gridUnit
122 anchors { 128 anchors {
123 left: parent.left 129 left: parent.left
124 right: parent.right 130 right: parent.right
125 } 131 }
126 spacing: Kube.Units.smallSpacing 132 spacing: Kube.Units.smallSpacing
127 Repeater { 133 model: Kube.CheckableEntityModel {
128 model: Kube.CheckableEntityModel { 134 id: calendarModel
129 id: calendarModel 135 type: "calendar"
130 type: "calendar" 136 roles: ["name", "color"]
131 roles: ["name", "color"] 137 }
132 } 138 delegate: Item {
133 delegate: Item { 139 width: parent.width
134 width: parent.width - Kube.Units.largeSpacing 140 height: Kube.Units.gridUnit
135 height: Kube.Units.gridUnit 141 RowLayout {
136 RowLayout { 142 anchors.fill: parent
137 anchors.fill: parent 143 spacing: Kube.Units.smallSpacing
138 spacing: Kube.Units.smallSpacing 144 Kube.CheckBox {
139 Kube.CheckBox { 145 opacity: 0.9
140 opacity: 0.9 146 checked: !model.checked
141 checked: !model.checked 147 onToggled: model.checked = !checked
142 onToggled: model.checked = !checked 148 }
143 } 149 Kube.Label {
144 Kube.Label { 150 Layout.fillWidth: true
145 Layout.fillWidth: true 151 text: model.name
146 text: model.name 152 color: Kube.Colors.highlightedTextColor
147 color: Kube.Colors.highlightedTextColor 153 elide: Text.ElideRight
148 elide: Text.ElideRight 154 clip: true
149 clip: true 155 }
150 } 156 Rectangle {
151 Rectangle { 157 anchors.verticalCenter: parent.verticalCenter
152 anchors.verticalCenter: parent.verticalCenter 158 width: Kube.Units.gridUnit
153 width: Kube.Units.gridUnit 159 height: width
154 height: width 160 radius: width / 2
155 radius: width / 2 161 color: model.color
156 color: model.color 162 opacity: 0.9
157 opacity: 0.9
158 }
159 } 163 }
160 } 164 }
161 } 165 }