LockScreen.qml 1.49 KB
Newer Older
Aaron J. Seigo's avatar
Aaron J. Seigo committed
1
import QtQuick 2.0
Aaron J. Seigo's avatar
Aaron J. Seigo committed
2
3
import org.kde.plasma.core 2.0 as PlasmaCore
import "../components"
Aaron J. Seigo's avatar
Aaron J. Seigo committed
4

Aaron J. Seigo's avatar
Aaron J. Seigo committed
5
Leaves {
6
7
    id: lockscreen

Aaron J. Seigo's avatar
Aaron J. Seigo committed
8
9
10
11
12
    PlasmaCore.Svg {
        id: symbolsSvg
        imagePath:  Qt.resolvedUrl("images/symbols.svgz")
    }

Aaron J. Seigo's avatar
Aaron J. Seigo committed
13
    MouseArea {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
14
        anchors.fill: parent
Aaron J. Seigo's avatar
Aaron J. Seigo committed
15
        onPressed: {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
16
            stripe.opacity = 1;
Aaron J. Seigo's avatar
Aaron J. Seigo committed
17
        }
Aaron J. Seigo's avatar
Aaron J. Seigo committed
18
19
    }

Aaron J. Seigo's avatar
Aaron J. Seigo committed
20
21
    SatelliteStripe {
        id: stripe
Aaron J. Seigo's avatar
Aaron J. Seigo committed
22
23
        opacity: 0

24
25
26
27
        function lockKeyPressed(id) {
            hideTimer.restart();
            console.log(id);
        }
Aaron J. Seigo's avatar
Aaron J. Seigo committed
28

29
30
31
32
33
        function lockKeyReleased(id) {
            hideTimer.restart();
            console.log(id);
        }

Aaron J. Seigo's avatar
Aaron J. Seigo committed
34
35
        Behavior on opacity {
            NumberAnimation {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
36
                duration: 500
Aaron J. Seigo's avatar
Aaron J. Seigo committed
37
38
39
                easing.type: Easing.InOutQuad
            }
        }
Aaron J. Seigo's avatar
Aaron J. Seigo committed
40

Aaron J. Seigo's avatar
Aaron J. Seigo committed
41
42
43
44
45
46
47
        Timer {
            id: hideTimer
            interval: 1000
            running: parent.opacity == 1
            onTriggered: parent.opacity = 0
        }

48
        LockKey {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
49
            id: square
50
            value: 1
Aaron J. Seigo's avatar
Aaron J. Seigo committed
51
            anchors.left: parent.left
Aaron J. Seigo's avatar
Aaron J. Seigo committed
52
53
54
            elementId: "square"
        }

55
        LockKey {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
56
            id: circle
57
            value: 2
Aaron J. Seigo's avatar
Aaron J. Seigo committed
58
59
60
61
62
            anchors.left: square.right

            elementId: "circle"
        }

63
        LockKey {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
64
            id: ex
65
            value: 3
Aaron J. Seigo's avatar
Aaron J. Seigo committed
66
67
68
69
70
71
            anchors.left: circle.right

            elementId: "ex"

        }

72
        LockKey {
Aaron J. Seigo's avatar
Aaron J. Seigo committed
73
            id: triangle
74
            value: 4
Aaron J. Seigo's avatar
Aaron J. Seigo committed
75
76
77
78
            anchors.left: ex.right

            elementId: "triangle"
        }
79
80
    }
}