-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.qml
More file actions
249 lines (212 loc) · 6.38 KB
/
Application.qml
File metadata and controls
249 lines (212 loc) · 6.38 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
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
Rectangle {
id: applicationInfo
width: main.defaultWidth
height: 40
color: "transparent"
property string url: ""
property string nome: ""
property string exec: ""
property bool _instance: false
property string pidname: ""
property bool minimize: true
property alias destak: destak
property alias effect: effect
property alias bgOpc: bgOpc
property bool destacad: false
ToolTip {
id: toolTip
x: 44
text: nome
delay: 500
timeout: 3000
visible: false
property bool timeActive: false
property alias timer: timer
contentItem: Label {
text: toolTip.text
wrapMode: Text.WordWrap
font: toolTip.font
color: "#ffffff"
}
background: Rectangle {
opacity: 0.9
color: main.detailInfoColor
}
Timer {
id: timer
running: false
interval: 1000
repeat: false
onTriggered: {
if (toolTip.timeActive) {
toolTip.visible = true
}
}
}
}
Rectangle {
id: destak
x: 1
y: parent.height - 3
height: 3
width: parent.width - 2
color: main.detailColor//"#007fff"
visible: true
opacity: 0//0.5//0.5
}
RectangularGlow {
id: effect
anchors.fill: destak
glowRadius: 0
spread: 0
color: main.detailColor
cornerRadius: destak.radius + glowRadius
opacity: 0
}
Rectangle {
id: bgOpc
anchors.fill: parent
color: main.detailColor//"#ffffff"
opacity: 0
}
Image {
id: appIcon
x: 12
y: 8
width: 24
height: 24
source: Context.crop(url) //"image://pixmap/" + url //url
fillMode: Image.PreserveAspectFit//Image.Stretch
antialiasing: true
smooth: true
cache: false
//rotation: -5
//transform: Rotation {angle: -20}
}
PropertyAnimation {id: ani; target: effect; property: "opacity"; to: 0.5; duration: 300}
/*
Image {
x: 4
y: 8
width: 4
height: 6//8
antialiasing: true
cache: false
fillMode: Image.PreserveAspectFit
source: "qrc:/Resources/thumbtack.svg"
transform: Rotation {angle: -42}
}
*/
Timer {
id: minimizeDelay
running: false
interval: 100
repeat: false
onTriggered: {
if (!Context.isMinimized(pidname) & Context.isActive(pidname)) {
Context.manyMinimizes(pidname)
minimize = false;
} else {
Context.manyActives(pidname)
minimize = true;
}
activeWindow()
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: {
//acessoRapido.visible = false
//acessoRapido.accessBlur.source = ""
main.arrowAside.text = '\uf106'
main.accessOpened = true
//neonMenu.visible = false
neonMenu.textSearch.focus = false
main.menuOpened = true
neonMenu.desactive()
if (mouse.button & Qt.LeftButton) {
showAppInfo.visible = false
neonMenu.textSearch.focus = false
//neonMenu.addApps()
//main.clickOpc = main.startOpc
if (!_instance) {
Context.exec(exec)
_instance = true
activeWindow()
} else {
minimizeDelay.stop()
minimizeDelay.start()
}
} else {
if (_instance) {
main.fixShowInfos.winIds = Context.windowsBywmclass(pidname)
main.fixShowInfos.exec = exec
main.fixShowInfos.y = main.y - 40
main.fixShowInfos.x = ((Context.mouseX() - mouseX) + (applicationInfo.width / 2)) - (main.fixShowInfos.width / 2)//Context.mouseX() - (showAppInfo.width / 2)
main.fixShowInfos.setText()
main.fixShowInfos.visible = true
main.fixShowInfos.requestActivate()
//clickOpc = startOpc
main.neonMenu.textSearch.focus = false
} else {
main.unfix.wmclass = pidname
main.unfix.listView.contentItem.children[0].children[1].setName(nome)
main.unfix.y = main.y - 70
main.unfix.x = ((Context.mouseX() - mouseX) + (applicationInfo.width / 2)) - (main.fixShowInfos.width / 2)//Context.mouseX() - (showAppInfo.width / 2)
main.unfix.visible = true
main.unfix.requestActivate()
//clickOpc = startOpc
main.neonMenu.textSearch.focus = false
}
}
}
hoverEnabled: true
onHoveredChanged: {
if (_instance) {
effect.glowRadius = 4
//effect.opacity = 0.8
destak.opacity = 0.3
ani.to = 0.8
ani.stop()
ani.start()
} else {
//effect.opacity = 0.5
effect.glowRadius = 0
destak.opacity = 0
ani.to = 0.5
ani.stop()
ani.start()
}
toolTip.timeActive = true
toolTip.timer.stop()
toolTip.timer.start()
}
onExited: {
if (destacad == false) {
effect.glowRadius = 0
//effect.opacity = 0
ani.to = 0.0
ani.stop()
ani.start()
if (_instance) {
destak.opacity = 0.3
} else {
destak.opacity = 0
}
}
toolTip.visible = false
toolTip.timeActive = false
}
}
on_InstanceChanged: {
if (_instance) {
destak.opacity = 0.5
} else {
destak.opacity = 0
}
}
}