-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.qml
More file actions
155 lines (133 loc) · 3.98 KB
/
app.qml
File metadata and controls
155 lines (133 loc) · 3.98 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
import QtQuick 2.9
import QtQuick.Controls 2.2
Rectangle {
id: rectangle
x: 0
y: 0
width: 74
height: 78
color: "transparent"
property string icone: ""
property string nome: ""
property string exec: ""
property string launcherApp: ""
property double iconOpc: 0.0
property alias bg: bg
Rectangle {
id: bg
anchors.fill: parent
color: main.detailColor//"#ffffff"
opacity: 0 //iconOpc
radius: 3
MouseArea {
id: mouseArea
width: 70
anchors.fill: parent
//drag.target: iconeApp
property bool _pressed: false
property bool _pressed2: false
property int mouseStart: 0
// onClicked: {
// Context.exec(exec, launcherApp)
// neonMenu.visible = false
// neonMenu.textSearch.focus = false
// main.clickOpc = main.startOpc
// }
onPressedChanged: {
if (_pressed2) {
//neonMenu.visible = false
neonMenu.textSearch.focus = false
main.menuOpened = true
neonMenu.desactive()
main.clickOpc = main.startOpc
Context.exec(exec, launcherApp)
}
if (!_pressed) {
_pressed = true
_pressed2 = true
mouseStart = mouseX
} else {
_pressed = false
_pressed2 = false
mouseStart = mouseX
parent.opacity = 0.0
main.clickOpc = main.startOpc
//neonMenu.visible = false
neonMenu.textSearch.focus = false
main.menuOpened = true
neonMenu.desactive()
neonMenu.addApps()
}
}
onMouseXChanged: {
if (_pressed2 && mouseX > mouseStart + 10) {
_pressed2 = false
Context.dragDrop(icone.replace("file://", ""), launcherApp)
//neonMenu.visible = false
neonMenu.textSearch.focus = false
main.menuOpened = true
neonMenu.desactive()
neonMenu.addApps()
}
//neonMenu.visible = true
//neonMenu.requestActivate()
}
hoverEnabled: true
onHoveredChanged: {
parent.opacity = 0.75
toolTip.visible = true
}
onExited: {
parent.opacity = 0.0
toolTip.visible = false
}
}
}
Image {
id: iconeApp
x: 12
y: 1
width: 48
height: 48
source: icone
antialiasing: true
smooth: true
//rotation: -5
fillMode: Image.PreserveAspectCrop
ToolTip {
id: toolTip
text: nome
delay: 500
timeout: 5000
visible: false
contentItem: Label {
text: toolTip.text
wrapMode: Text.WordWrap
font: toolTip.font
color: "#ffffff"
}
background: Rectangle {
opacity: 0.9
color: "#000000"
}
}
}
Text {
id: name
y: 42
height: 8
text: nome.length < 9 ? nome : nome.substring(0, 9) + '...'
font.pointSize: 8
wrapMode: Text.NoWrap
anchors.right: parent.right
anchors.rightMargin: 7
anchors.left: parent.left
anchors.leftMargin: 7
anchors.bottom: parent.bottom
anchors.bottomMargin: 8
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: textColor
font.family: main.fontName
}
}