From 19acec2796c26bd902472ddd87858fac4d20ada4 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 30 Nov 2015 13:49:53 +0100 Subject: Fade to black Change-Id: Ib8cb64c1c3d84bf79e70bab3c353519f7daadd92 Reviewed-by: Eskil Abrahamsen Blomfeldt --- wayland/democompositor/qml/Screen.qml | 32 ++++++++++++++++++++++++++---- wayland/democompositor/qml/TimedButton.qml | 8 +++++++- 2 files changed, 35 insertions(+), 5 deletions(-) (limited to 'wayland') diff --git a/wayland/democompositor/qml/Screen.qml b/wayland/democompositor/qml/Screen.qml index 9ab3557..ca26683 100644 --- a/wayland/democompositor/qml/Screen.qml +++ b/wayland/democompositor/qml/Screen.qml @@ -62,6 +62,30 @@ WaylandOutput { id: launcher } + + Rectangle { + id: curtain + color: "black" + anchors.fill: parent + opacity: 0 + z: 100 + } + + SequentialAnimation { + id: quitAnimation + + PropertyAnimation { + target: curtain + property: "opacity" + duration: 500 + to: 1 + easing.type: Easing.InQuad + } + ScriptAction { + script: Qt.quit() + } + } + Rectangle { id: sidebar @@ -140,26 +164,26 @@ WaylandOutput { height: 30 width: sidebar.width - 10 text.text: "Launch wiggly" - executable: "/tmp/wiggly" + executable: "./wiggly" } LaunchButton { height: 30 width: sidebar.width - 10 text.text: "Launch analog clock" - executable: "/tmp/analogclock" + executable: "./analogclock" } LaunchButton { height: 30 width: sidebar.width - 10 text.text: "Launch digital clock" - executable: "/tmp/digitalclock" + executable: "./digitalclock" } TimedButton { //visible: false height: 50 width: sidebar.width - 10 text: "Quit" - onTriggered: Qt.quit() + onTriggered: quitAnimation.start() } } } diff --git a/wayland/democompositor/qml/TimedButton.qml b/wayland/democompositor/qml/TimedButton.qml index 012875a..2134e4d 100644 --- a/wayland/democompositor/qml/TimedButton.qml +++ b/wayland/democompositor/qml/TimedButton.qml @@ -54,7 +54,11 @@ Rectangle { }, State { name: "PRESSED" + }, + State { + name: "TRIGGERED" } + ] transitions: [ Transition { @@ -111,8 +115,10 @@ Rectangle { onReleased: { if (containsMouse && parent.percent >= 100) { parent.triggered() + parent.state = "TRIGGERED" + } else { + parent.state = "UNPRESSED" } - parent.state = "UNPRESSED" } onPositionChanged: { -- cgit v1.2.3