-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNeonMenu.qml
More file actions
595 lines (504 loc) · 13.7 KB
/
Copy pathNeonMenu.qml
File metadata and controls
595 lines (504 loc) · 13.7 KB
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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
import QtQuick 2.9
import QtQuick.Window 2.3
import QtQuick.Controls 1.4
import QtGraphicalEffects 1.0
import QtQuick.Controls.Styles 1.4
import "../"
Window {
id: neonMenu
visible: false
x: 0//30
y: main.y - neonMenu.height
width: 470//530
height: 530
title: "Synth-Panel"
color: "transparent"
opacity: 0
flags: Qt.Tool | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Popup
property var menuElements: []
property var textSearch: textSearch
property string textColor: "#fff"
//property alias blur: blur
property alias aniMenu: aniMenu
property alias aniMenu2: aniMenu2
function addApps() {
var x = 0
var y = 0
for (var i = 0; i < menuElements.length; i++) {
menuElements[i].x = x
menuElements[i].y = y
x += 74
if (x + 74 >= neonMenu.width) {
x = 0
y += 78
}
menuElements[i].visible = true
}
launchersApps.height = y;
}
function desfocusApps() {
for (var i = 0; i < launchersApps.children.length; i++) {
launchersApps.children[i].bg.opacity = 0
}
}
onActiveChanged: {
if (!active) {
aniMenu.to = 0
aniMenu.duration = 200
aniMenu.stop()
aniMenu.start()
aniMenu2.to = 30
aniMenu2.stop()
aniMenu2.start()
main.menuOpened = true
} else {
aniMenu.to = 1
aniMenu.duration = 100
aniMenu.stop()
aniMenu.start()
aniMenu2.to = 0
//aniMenu2.stop()
//aniMenu2.start()
main.menuOpened = false
neonMenu.x = 0
visible = true
//opacity = 1
}
}
onVisibleChanged: {
if (visible) {
neonMenu.x = 0
aniMenu2.to = 0
main.menuOpened = false
//aniMenu2.stop()
//aniMenu2.start()
main.menuOpened = false
if (neonMenu.width >= Screen.width - 10) {
blur.source = Context.blurEffect(neonMenu)
} else {
blur.source = Context.blurEffect(neonMenu, 0)
}
}
}
function desactive() {
/*
aniMenu.to = 0
aniMenu.stop()
aniMenu.start()
aniMenu2.to = 30
aniMenu2.stop()
aniMenu2.start()
main.menuOpened = true
*/
visible = false
opacity = 0
neonMenu.x = 0
}
MouseArea {
id: mouseMenu
anchors.fill: parent
onClicked: {
//addApps()
textSearch.focus = false
textSearch.text = qsTr("Search...")
showAppInfo.visible = false
}
}
BlurEffect {
id: blur
}
Rectangle {
id: bg
anchors.fill: parent
color: blurColor
opacity: blurColorOpc
}
Image {
anchors.fill: parent
source: "/Resources/noise.png"
opacity: 0.1
}
/*
Image {
id: blur
x: 0
y: (~neonMenu.y) + 1
width: Screen.width
height: Screen.height - main.height
source: "image://grab/crop"
visible: false
cache: false
//clip: true
}
FastBlur {
id: fastBlur
anchors.fill: blur
source: blur
radius: main.blurControl
}
Blend {
id: blend
anchors.fill: fastBlur
source: fastBlur
foregroundSource: fastBlur
mode: "softLight"
opacity: main.blurControlOpc
}
HueSaturation {
id: saturation
anchors.fill: blur
source: fastBlur
hue: 0
saturation: main.blurSaturation
lightness: 0
}
Image {
id: overlay
anchors.fill: blur
source: "qrc:/Resources/noise.png"
fillMode: Image.Tile
antialiasing: true
smooth: true
}
Blend {
id: blend2
anchors.fill: overlay
source: overlay
foregroundSource: saturation
mode: "addition"
opacity: 1
}
Rectangle {
anchors.fill: blur
opacity: main.blurColorOpc//0.7
color: main.blurColor//"#161616"
}
*/
Rectangle {
id: resize
x: 470
width: 18
height: 18
color: "#ffffff"
opacity: 0.0
anchors.top: parent.top
anchors.topMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
MouseArea {
anchors.fill: parent
cursorShape: Qt.SizeAllCursor
property int startX: 0
property int startY: 0
property bool btnUp: true
/*
onReleased: {
neonMenu.width += mouseX
neonMenu.height -= mouseY
neonMenu.y += mouseY
}
*/
onPressedChanged: {
if (btnUp) {
btnUp = false
startX = mouseX - 18
startY = mouseY
} else {
btnUp = true
addApps()
//neonMenu.y = main.y - neonMenu.height//(neonMenu.height + 4)
textSearch.focus = false
textSearch.text = "Buscar..."
blur.source = Context.blurEffect(neonMenu)
}
}
onMouseXChanged: {
neonMenu.width = Context.mouseX() - startX
neonMenu.y = Context.mouseY() - startY
neonMenu.height = main.y - neonMenu.y//(neonMenu.y + 5)
}
}
}
Rectangle {
id: rectangleTop
height: 80
color: "#000000"
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: parent.top
anchors.topMargin: 0
opacity: 0.0
}
Rectangle {
id: subMask
width: 52
height: 52
antialiasing: true
anchors.left: parent.left
anchors.leftMargin: 22
anchors.top: parent.top
anchors.topMargin: 14
visible: true
radius: 33
color: main.detailColor
Rectangle {
id: mask
width: 52
height: 52
antialiasing: true
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: parent.top
anchors.topMargin: 16
visible: false
radius: 32
}
}
Image {
id: image
width: 48
height: 48
antialiasing: true
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: parent.top
anchors.topMargin: 16
source: Context.imagePerfil()
fillMode: Image.PreserveAspectCrop
layer.enabled: true
layer.effect: OpacityMask {
antialiasing: true
maskSource: mask
}
}
Rectangle {
id: rectangle2
x: 0
y: 436
height: 50
color: "transparent"
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.rightMargin: 0
anchors.left: parent.left
opacity: 1
anchors.right: parent.right
anchors.leftMargin: 0
Rectangle {
id: search
color: "#333"
anchors.right: parent.right
anchors.rightMargin: 20
anchors.left: parent.left
anchors.leftMargin: 15
anchors.bottom: parent.bottom
anchors.bottomMargin: 12
anchors.top: parent.top
anchors.topMargin: 12
opacity: 0.5
}
}
TextInput {
id: textSearch
x: 0
y: 410
height: 30
color: "#fff"
anchors.right: parent.right
anchors.rightMargin: 25
anchors.left: parent.left
anchors.leftMargin: 20
anchors.bottom: parent.bottom
anchors.bottomMargin: 10
text: ""
antialiasing: true
//cursorVisible: true
focus: true
font.bold: false
font.pointSize: 12
font.family: main.fontName
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
selectionColor: main.detailColor
selectByMouse: true
wrapMode: TextEdit.Wrap
onFocusChanged: {
text = ""
}
Keys.onReleased: {
var x = 0
var y = 0
for (var i = 0; i < menuElements.length; i++) {
if(menuElements[i].nome.toLowerCase().search(text.toLowerCase()) !== -1) {
menuElements[i].x = x
menuElements[i].y = y
x += 74
if (x + 74 >= neonMenu.width) {
x = 0
y += 78
}
menuElements[i].visible = true
} else {
menuElements[i].visible = false
}
}
launchersApps.height = y
}
}
Text {
id: text1
width: 149
height: 14
text: Context.userName() //qsTr("SHENOISZ")
anchors.left: parent.left
anchors.leftMargin: 90
anchors.top: parent.top
anchors.topMargin: 33
font.bold: false
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
font.pixelSize: 14
font.family: main.fontName
color: textColor
}
ScrollView {
id: scrollview1
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 2
anchors.bottom: parent.bottom
anchors.bottomMargin: 50
anchors.top: parent.top
anchors.topMargin: 80
antialiasing: true
highlightOnFocus: true
frameVisible: false
// Rectangle {
// anchors.fill: parent
// color: "#fff"
// }
Item {
id: launchersApps
height: 338
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: parent.top
anchors.topMargin: 0
}
style: ScrollViewStyle {
incrementControl: null
decrementControl: null
transientScrollBars: false
handle: Rectangle {
implicitWidth: 6
implicitHeight: 6
color: main.detailColor//styleData.pressed ? "dimgray" : "gray"
}
scrollBarBackground: Rectangle {
implicitWidth: 6
implicitHeight: 6
color: "#33000000"
}
}
}
Rectangle {
id: rectangle3
x: 450
y: 30
width: 18
height: 14
color: "transparent"
anchors.top: parent.top
anchors.topMargin: 32
anchors.right: parent.right
anchors.rightMargin: 34
visible: false
Rectangle {
id: rectangle4
width: 18
height: 2
color: textColor
}
Rectangle {
id: rectangle5
x: 0
y: 6
width: 18
height: 2
color: textColor
}
Rectangle {
id: rectangle6
x: 0
y: 12
width: 18
height: 2
color: textColor
}
}
function updateApps() {
var apps = Context.applications()
var comp = Qt.createComponent("app.qml")
var x = 0
var y = 0
for (var i = 0; i < menuElements.length; i++) {
delete menuElements[i]
}
menuElements = []
for (var i = 0; i < launchersApps.children.length; i++) {
delete launchersApps.children[i]
}
launchersApps.children = []
for (var i = 0; i < apps.length; i ++) {
var app = apps[i].split(';')
//if (app[0] !== "" & app[1] !== "") {
if (app[0] !== "") {
var obj = comp.createObject(launchersApps, {'x': x, 'y': y, 'nome': app[0], 'icone': app[1], 'exec': app[2], 'launcherApp': 'file://' + app[3]})
if (obj.icone !== "file://") {
obj.iconOpc = 0.0
menuElements.push(obj)
x += 74
if (x + 74 >= neonMenu.width) {
x = 0
y += 78
}
} else {
//obj.destroy()
}
}
}
launchersApps.height = y
}
Component.onCompleted: {
updateApps()
}
PropertyAnimation {id: aniMenu2; target: neonMenu; property: "x"; to: 0; duration: 200;
onStopped: {
neonMenu.x = 0
aniMenu2.to = 0
}
}
PropertyAnimation {id: aniMenu; target: neonMenu; property: "opacity"; to: 1; duration: 200;
onStopped: {
if (to === 0) {
main.menuOpened = true
textSearch.text = ""
textSearch.focus = true
neonMenu.visible = false
main.clickOpc = main.startOpc
textSearch.focus = false
//addApps()
//blur.source = ""
desfocusApps()
arrowAside.text = '\uf106'
btnCycle.border.color = "#fff"
main.activeWindow()
}
}
}
}