-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
347 lines (312 loc) · 10 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
import QtQuick 2.13
import QtQuick.Window 2.13
import QtLocation 5.13
import QtQuick.Controls 2.5
import QtPositioning 5.13
import QtQuick.Extras 1.4
Window {
id: window
visible: true
width: 640
height: 480
title: qsTr("MapMe!")
Connections{
target: Locator
onPositionUpdatedView : {
marker.visible =true
marker.anchorPoint.x = image_marker.width/4
marker.anchorPoint.y = image_marker.height
marker.coordinate = info
}
onAddressUpdatedView:{
message.showMessage(address)
map.center = marker.coordinate
nav_icon_locate_me.visible = true
busyIndicator.visible = false
}
}
function toggleMenu(){
if(menu.x == 0 ){
menu.x = -250
nav_icon.text = "\uF35C"
}else{
menu.x = 0
nav_icon.text = "\uF156"
}
}
function showCalendar(){
calendar_view.x = 0
settings_view.x = -settings_view.width
toggleMenu()
}
function showSettings(){
settings_view.x = 0
calendar_view.x = -calendar_view.width
toggleMenu()
}
function showMap(){
calendar_view.x = -calendar_view.width
settings_view.x = -settings_view.width
toggleMenu()
}
Plugin {
id: mapPlugin
name: "here"
PluginParameter{name: "here.app_id"; value: "YcFcRULoKXQ7uFyyUFXi"}
PluginParameter{name: "here.token"; value: "RrY07ZqUc93icAWoP0FDIg"}
}
Map {
id: map
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.right: parent.right
anchors.left: parent.left
anchors.top: parent.top
plugin: mapPlugin
zoomLevel: 10
Behavior on zoomLevel { SmoothedAnimation { velocity: 500 } }
Behavior on center {
CoordinateAnimation {
duration: 500
easing.type: Easing.InOutQuad
}
}
center: QtPositioning.coordinate(23.11, -82.36)
MapQuickItem {
id: marker
visible: false
sourceItem: Image {
id: image_marker
width: 50
height: 50
source: "icon.png"
fillMode: Image.PreserveAspectFit
}
}
Rectangle {
id: top_bar
height: 50
color: "#000000"
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: parent.top
anchors.topMargin: 0
Text {
id: nav_icon
width: 50
color: "#ffffff"
text:"\uF35C"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.top: parent.top
font.family: "Material Design Icons"
font.pixelSize: 30
opacity: 1
MouseArea{
id: menu_trigger
anchors.fill: parent
onClicked: {
toggleMenu()
}
}
}
Text {
id: label_title
font.family: "sans-serif"
color: "#ffffff"
text: qsTr("MapMe!")
anchors.left: parent.left
anchors.leftMargin: 0
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.top: parent.top
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 20
}
}
Rectangle {
id: menu
x: -250
z: 100
width: 250
color: "#000000"
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.top: top_bar.bottom
anchors.topMargin: 0
Behavior on x { SmoothedAnimation { velocity: 400 } }
Text {
id: menu_option_1
height: 50
color: "#ffffff"
text: "Location History"
textFormat: Text.PlainText
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: menu_option_3.bottom
anchors.topMargin: 0
font.pixelSize: 20
MouseArea{
anchors.fill: parent
onClicked: {
showCalendar()
}
}
}
Text {
id: menu_option_2
x: -9
y: -8
height: 50
color: "#ffffff"
text: qsTr("Settings")
anchors.right: parent.right
font.pixelSize: 20
horizontalAlignment: Text.AlignHCenter
anchors.top: menu_option_1.bottom
anchors.leftMargin: 0
anchors.topMargin: 0
anchors.rightMargin: 0
verticalAlignment: Text.AlignVCenter
anchors.left: parent.left
MouseArea{
anchors.fill: parent
onClicked: {
showSettings()
}
}
}
Text {
id: menu_option_3
x: -18
height: 50
color: "#ffffff"
text: qsTr("Map")
MouseArea {
anchors.topMargin: 10
anchors.fill: parent
}
anchors.right: parent.right
anchors.leftMargin: 0
anchors.rightMargin: 0
horizontalAlignment: Text.AlignHCenter
font.pixelSize: 20
anchors.left: parent.left
verticalAlignment: Text.AlignVCenter
anchors.top: parent.top
anchors.topMargin: 0
MouseArea{
anchors.fill: parent
onClicked: {
showMap()
}
}
}
}
Rectangle {
id: floating_button
x: 582
y: 422
z:90
width: 50
height: 50
color: "#000000"
radius: 25
anchors.right: parent.right
anchors.rightMargin: 10
anchors.bottom: parent.bottom
anchors.bottomMargin: 10
border.width: 0
Text {
id: nav_icon_locate_me
width: 50
color: "#ffffff"
text: "\uF34E"
font.pixelSize: 30
horizontalAlignment: Text.AlignHCenter
MouseArea {
id: mouse_area_locate_me
anchors.fill: parent
onClicked: {
nav_icon_locate_me.visible = false
Locator.startLocation()
busyIndicator.visible = true
}
}
anchors.top: parent.top
anchors.bottom: parent.bottom
opacity: 1
verticalAlignment: Text.AlignVCenter
font.family: "Material Design Icons"
anchors.left: parent.left
}
BusyIndicator {
id: busyIndicator
font.pointSize: 10
anchors.fill: parent
visible: false
}
}
Message {
id: message
x: 230
y: 56
width: 250
height: 30
anchors.right: parent.right
anchors.rightMargin: 10
}
Rectangle {
id: calendar_view
width: window.width
height: window.height-top_bar.height
x: -window.width
y:0
z:91
color: "#ffffff"
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.top: top_bar.bottom
anchors.topMargin: 0
Behavior on x { SmoothedAnimation { velocity: 400 } }
CalendarView {
id: calendar_View
anchors.fill: parent
}
}
Rectangle {
id: settings_view
color: "#ffffff"
anchors.top: top_bar.bottom
anchors.topMargin: 0
width: window.width
height: window.height-top_bar.height
x: -window.width
z:92
Behavior on x { SmoothedAnimation { velocity: 400 } }
SettingsView {
id: settingsView
anchors.fill: parent
}
}
}
}
/*##^## Designer {
D{i:3;anchors_width:200;anchors_x:174;anchors_y:52}D{i:4;anchors_x:324;anchors_y:18}
D{i:7;anchors_height:200;anchors_x:42;anchors_y:110}D{i:6;anchors_height:200;anchors_x:42;anchors_y:110}
D{i:10;anchors_x:324;anchors_y:18}D{i:9;anchors_x:79;anchors_y:31}D{i:11;anchors_height:200;anchors_x:324;anchors_y:18}
D{i:8;anchors_x:79;anchors_y:31}D{i:17;anchors_y:-16}D{i:12;anchors_height:200;anchors_x:42;anchors_y:110}
D{i:21;anchors_x:230;anchors_y:56}D{i:20;anchors_x:22;anchors_y:18}D{i:22;anchors_x:230;anchors_y:56}
D{i:23;anchors_x:230;anchors_y:56}D{i:24;anchors_height:200;anchors_y:106}D{i:26;anchors_height:200;anchors_width:200;anchors_x:161;anchors_y:0}
D{i:5;anchors_height:200;anchors_x:42;anchors_y:110}
}
##^##*/