diff --git a/containments/homescreen/package/contents/ui/FeedbackWindow.qml b/containments/homescreen/package/contents/ui/FeedbackWindow.qml new file mode 100644 index 00000000..da91e8ab --- /dev/null +++ b/containments/homescreen/package/contents/ui/FeedbackWindow.qml @@ -0,0 +1,101 @@ +/* + * Copyright 2015 Marco Martin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +import QtQuick 2.0 +import QtQuick.Layouts 1.1 +import QtQuick.Window 2.2 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.components 2.0 as PlasmaComponents + +Window { + id: window + + property alias state: background.state + width: Screen.width + height: Screen.height + color: "transparent" + onVisibleChanged: { + if (!visible) { + background.state = "closed"; + } + } + onActiveChanged: { + if (!active) { + background.state = "closed"; + } + } + + Rectangle { + id: background + color: Qt.rgba(0, 0, 0, 0.8) + width: window.width + height: window.height + state: "closed" + + PlasmaCore.ColorScope { + anchors.fill: parent + colorGroup: PlasmaCore.Theme.ComplementaryColorGroup + PlasmaComponents.BusyIndicator { + anchors.centerIn: parent + } + } + + states: [ + State { + name: "closed" + PropertyChanges { + target: background + scale: 0 + } + PropertyChanges { + target: window + visible: false + } + }, + State { + name: "open" + PropertyChanges { + target: background + scale: 1 + } + PropertyChanges { + target: window + visible: true + } + } + ] + + transitions: [ + Transition { + from: "closed" + SequentialAnimation { + ScriptAction { + script: window.visible = true; + } + PropertyAnimation { + target: background + duration: units.longDuration + easing.type: Easing.InOutQuad + properties: "scale" + } + } + } + ] + } +} diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 2ae0ebd1..93171728 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -256,6 +256,7 @@ MouseEventListener { return; } + feedbackWindow.state = "open"; plasmoid.nativeInterface.applicationListModel.runApplication(item.modelData.ApplicationStorageIdRole); clickFedbackAnimation.target = item; clickFedbackAnimation.running = true; @@ -281,6 +282,9 @@ MouseEventListener { easing.type: Easing.InOutQuad } } + FeedbackWindow { + id: feedbackWindow + } PlasmaCore.ColorScope { anchors.fill: parent //TODO: decide what color we want applets