-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLockOsd.qml
More file actions
72 lines (62 loc) · 1.86 KB
/
Copy pathLockOsd.qml
File metadata and controls
72 lines (62 loc) · 1.86 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
/*
SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
import QtQuick
import org.kde.ksvg as KSvg
import org.kde.kirigami as Kirigami
import org.kde.plasma.workspace.osd
KSvg.FrameSvgItem {
id: osd
property alias timeout: osdItem.timeout
property alias osdValue: osdItem.osdValue
property alias osdMaxValue: osdItem.osdMaxValue
property alias icon: osdItem.icon
property alias showingProgress: osdItem.showingProgress
objectName: "onScreenDisplay"
visible: false
width: osdItem.width + margins.left + margins.right
height: osdItem.height + margins.top + margins.bottom
imagePath: "dialogs/background"
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami.Theme.Window
function show() {
osd.visible = true;
hideAnimation.restart();
}
// avoid leaking ColorScope of lock screen theme into the OSD "popup"
Item {
width: osdItem.width
height: osdItem.height
anchors.centerIn: parent
OsdItem {
id: osdItem
}
}
SequentialAnimation {
id: hideAnimation
ScriptAction {
// prevent opacity layering of ProgressBar.
script: osd.layer.enabled = true
}
// prevent press and hold from flickering
PauseAnimation { duration: osd.timeout }
NumberAnimation {
target: osd
property: "opacity"
from: 1
to: 0
duration: Kirigami.Units.shortDuration
easing.type: Easing.InQuad
}
ScriptAction {
script: {
osd.visible = false;
osd.opacity = 1;
osd.icon = "";
osd.osdValue = 0;
osd.layer.enabled = false;
}
}
}
}