forked from Bali10050/kdepanelapps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.qml
More file actions
153 lines (100 loc) · 2.66 KB
/
Copy pathtask.qml
File metadata and controls
153 lines (100 loc) · 2.66 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
Kirigami.Icon {
id: icon
anchors.fill: parent
active: false
enabled: true
source: model.decoration
z: 999
clip: false
transform: Translate {
id: iconTranslate
y: 0
}
}
Item {
anchors.fill: parent
z: 1000 // Ensure it's on top
Timer {
id: launchDelayTimer
interval: 350
repeat: false
onTriggered: {
TaskTools.activateTask(modelIndex(), model, Qt.NoModifier, task, Plasmoid, tasksRoot, effectWatcher.registered);
}
}
TapHandler {
acceptedButtons: Qt.LeftButton
gesturePolicy: TapHandler.ReleaseWithinBounds // triggers when released inside
onTapped: (eventPoint, button) => {
// Bounce always on click
clickBounceAnim.restart();
if (!model.IsWindow) {
// App is closed: bounce first, delay launch
launchDelayTimer.start();
} else {
// App is open: activate normally
TaskTools.activateTask(modelIndex(), model, eventPoint.modifiers, task, Plasmoid, tasksRoot, effectWatcher.registered);
}
eventPoint.accepted = false;
}
}
}
SequentialAnimation {
id: clickBounceAnim
running: false
loops: 1
ScriptAction {
script: {
bounceDown.from = iconTranslate.y
bounceDown.to = 6
}
}
PropertyAnimation {
id: bounceDown
target: iconTranslate
property: "y"
duration: 100
easing.type: Easing.InOutCubic
}
PropertyAnimation {
target: iconTranslate
property: "y"
to: -10
duration: 160
easing.type: Easing.OutCubic
}
PropertyAnimation {
target: iconTranslate
property: "y"
to: 0
duration: 160
easing.type: Easing.InCubic
}
}
Rectangle {
id: openBar
width: model.IsWindow && model.IsActive ? 28 : 12
height: 2.5
radius: height / 2
anchors.horizontalCenter: icon.horizontalCenter
anchors.bottom: icon.bottom
anchors.bottomMargin: -1.5
color: model.IsWindow && model.IsActive
? Qt.rgba(1, 1, 1, 0.9) // Qt.rgba(0.239, 0.682, 0.913, 1.0)
: Qt.rgba(1, 1, 1, 0.5) // white with 50% opacity
visible: model.IsWindow && !model.IsLauncher
// Animate width change
Behavior on width {
NumberAnimation {
duration: 200
easing.type: Easing.InOutQuad
}
}
// Animate color change
Behavior on color {
ColorAnimation {
duration: 200
easing.type: Easing.InOutQuad
}
}
}