diff options
Diffstat (limited to 'views/calendar/qml/MonthView.qml')
-rw-r--r-- | views/calendar/qml/MonthView.qml | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/views/calendar/qml/MonthView.qml b/views/calendar/qml/MonthView.qml new file mode 100644 index 00000000..a4505eef --- /dev/null +++ b/views/calendar/qml/MonthView.qml | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2018 Michael Bohlender, <bohlender@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.3 | ||
22 | import Qt.labs.calendar 1.0 | ||
23 | |||
24 | import org.kube.framework 1.0 as Kube | ||
25 | |||
26 | FocusScope { | ||
27 | id: root | ||
28 | |||
29 | DayOfWeekRow { | ||
30 | anchors { | ||
31 | left: monthGrid.left | ||
32 | bottom: monthGrid.top | ||
33 | } | ||
34 | width: monthGrid.width | ||
35 | |||
36 | delegate: Kube.Label { | ||
37 | text: model.shortName | ||
38 | } | ||
39 | } | ||
40 | |||
41 | MonthGrid { | ||
42 | id: monthGrid | ||
43 | |||
44 | anchors.centerIn: parent | ||
45 | |||
46 | spacing: 0 | ||
47 | |||
48 | delegate: Rectangle { | ||
49 | width: Kube.Units.gridUnit * 7 | ||
50 | height: Kube.Units.gridUnit * 5 | ||
51 | |||
52 | color: Kube.Colors.viewBackgroundColor | ||
53 | border.color: Kube.Colors.buttonColor | ||
54 | border.width: 1 | ||
55 | |||
56 | Item { | ||
57 | id: dayInfo | ||
58 | |||
59 | height: Kube.Units.gridUnit | ||
60 | width: parent.width | ||
61 | |||
62 | Kube.Label { | ||
63 | anchors { | ||
64 | top: parent.top | ||
65 | left: parent.left | ||
66 | topMargin: Kube.Units.smallSpacing | ||
67 | leftMargin: Kube.Units.smallSpacing | ||
68 | } | ||
69 | text: model.day | ||
70 | } | ||
71 | } | ||
72 | |||
73 | ListView { | ||
74 | anchors { | ||
75 | top: dayInfo.bottom | ||
76 | left: parent.left | ||
77 | right: parent.right | ||
78 | bottom: parent.bottom | ||
79 | topMargin: Kube.Units.smallSpacing | ||
80 | leftMargin: 1 | ||
81 | rightMargin: 1 | ||
82 | } | ||
83 | clip: true | ||
84 | |||
85 | model: 2 | ||
86 | |||
87 | delegate: Rectangle { | ||
88 | |||
89 | width: parent.width - 2 | ||
90 | height: Kube.Units.gridUnit | ||
91 | color: "blue" | ||
92 | border.width: 1 | ||
93 | border.color: Kube.Colors.viewBackgroundColor | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | } | ||