Commit 69b7459f authored by Marco Martin's avatar Marco Martin

Add a fake startup notification window

add a window shown when an application is started
hide the window when a new one appears.

it's an approximation, we still need a real startup notification system
parent 578f998f
/*
* Copyright 2015 Marco Martin <notmart@gmail.com>
*
* 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"
}
}
}
]
}
}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment