-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
209 lines (188 loc) · 7.02 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
* Copyright (C) 2016 - Sylvia van Os <[email protected]>
* Copyright (C) 2015 - Florent Revest <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import org.asteroid.controls 1.0
import org.asteroid.utils 1.0
Application {
id: app
property var keys: Object.keys(taskObj)
property date currentDate: new Date()
property int year: currentDate.getFullYear()
property int month: currentDate.getMonth()+1
property int day: currentDate.getDate()
property string passDate: year.toString() + month.toString() + day.toString()
// property string writeDate: year.toString() + '/' + month.toString() + '/' + day.toString()
// make change color if tasks are done
centerColor: "#cc66ff"
outerColor: "#6600cc"
// components to call from each list item
Component { id: floatLayer; FloatPage { } }
Component { id: dateLayer; DatePage { } }
Component { id: binaryLayer; BinaryPage { } }
Component { id: aboutLayer; AboutPage { } }
// Component { id: dataLayer; DataView { } }
// NEED FOR these will be defined in c++
property var taskObj: jedt.addToday(dataObj, passDate)
property var todayArr: taskObj[passDate]
property var dateKeys: taskObj.keys()
property var inLength: todayArr.length
property var passArr: null
property var passIndex: null
LayerStack {
id: layerStack
firstPage: firstPageComponent
}
Component {
id: firstPageComponent
Flickable {
contentHeight: (inLength + 6)*Dims.h(16) + (DeviceInfo.hasRoundScreen ? Dims.h(20) : 0)
contentWidth: width
boundsBehavior: Flickable.DragOverBounds
flickableDirection: Flickable.VerticalFlick
Column {
anchors.fill: parent
Item { width: parent.width; height: DeviceInfo.hasRoundScreen ? Dims.h(10) : 0 }
signal sendMessage(string icon)
ListItem {
//% "ACTUALDATE"
title: qsTrId(passDate)
}
ListItem {
//% "PRACTICE"
title: qsTrId(todayArr[0][0])
iconName: todayArr[0][5]
onClicked: {
passArr = todayArr[0];
passIndex = 0
layerStack.push(floatLayer);
}
}
ListItem {
//% "FLOSS"
title: qsTrId(todayArr[1][0])
iconName: todayArr[1][5]
onClicked: {
passArr = todayArr[1];
passIndex = 1
layerStack.push(binaryLayer);
}
}
//% "EXERCISE"
ListItem {
title: qsTrId(todayArr[2][0])
iconName: todayArr[2][5]
onClicked: {
passArr = todayArr[2];
passIndex = 2
layerStack.push(floatLayer);
}
}
//% "READ"
ListItem {
title: qsTrId(todayArr[3][0])
iconName: todayArr[3][5]
onClicked: {
passArr = todayArr[3];
passIndex = 3
layerStack.push(floatLayer);
}
}
//% "WORK"
ListItem {
title: qsTrId(todayArr[4][0])
iconName: todayArr[4][5]
onClicked: {
passArr = todayArr[4];
passIndex = 4
layerStack.push(floatLayer);
}
}
//% "WALK"
ListItem {
title: qsTrId(todayArr[5][0])
iconName: todayArr[5][5]
onClicked: {
passArr = todayArr[5];
passIndex = 5
layerStack.push(floatLayer);
}
}
//% "IRON"
ListItem {
title: qsTrId(todayArr[6][0])
iconName: todayArr[6][5]
onClicked: {
passArr = todayArr[6];
passIndex = 6
layerStack.push(binaryLayer);
}
}
//% "SLEEP"
ListItem {
title: qsTrId(todayArr[7][0])
iconName: todayArr[7][5]
onClicked: {
passArr = todayArr[7];
passIndex = 7
layerStack.push(floatLayer);
}
}
//% "BEER"
ListItem {
title: qsTrId(todayArr[8][0])
iconName: todayArr[8][5]
onClicked: {
passArr = todayArr[8];
passIndex = 8
layerStack.push(floatLayer);
}
}
ListItem {
//% "OPTIONS"
title: qsTrId("OPT")
/* onClicked: {
layerStack.push(dataLayer)
}
*/ }
ListItem {
//% "Date"
title: qsTrId("date")
iconName: "ios-calendar-outline"
onClicked: layerStack.push(dateLayer)
}
ListItem {
//% "Add"
title: qsTrId("add")
iconName: "ios-add-circle-outline"
}
ListItem {
//% "Remove"
title: qsTrId("rem")
iconName: "ios-remove-circle-outline"
}
ListItem {
//% "About"
title: qsTrId("about")
iconName: "ios-code"
onClicked: layerStack.push(aboutLayer)
}
Item { width: parent.width; height: DeviceInfo.hasRoundScreen ? Dims.h(10) : 0 }
}
}
}
}