mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 07:03:08 +00:00
remove local feedbackWindow
This commit is contained in:
parent
d2f196e0c3
commit
91c92f8fa1
3 changed files with 18 additions and 138 deletions
|
|
@ -1,128 +0,0 @@
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import QtGraphicalEffects 1.12
|
|
||||||
|
|
||||||
import org.kde.phone.homescreen 1.0
|
|
||||||
|
|
||||||
Window {
|
|
||||||
id: window
|
|
||||||
|
|
||||||
property alias state: background.state
|
|
||||||
property alias icon: icon.source
|
|
||||||
width: Screen.width
|
|
||||||
height: Screen.height
|
|
||||||
color: "transparent"
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (!visible) {
|
|
||||||
background.state = "closed";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onActiveChanged: {
|
|
||||||
if (!active) {
|
|
||||||
background.state = "closed";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: background
|
|
||||||
anchors.fill: parent
|
|
||||||
//colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
|
||||||
width: window.width
|
|
||||||
height: window.height
|
|
||||||
state: "closed"
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: PlasmaCore.Theme.backgroundColor
|
|
||||||
Rectangle {
|
|
||||||
id: rect
|
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
id: icon
|
|
||||||
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
|
|
||||||
width: units.iconSizes.enormous
|
|
||||||
height: width
|
|
||||||
}
|
|
||||||
DropShadow {
|
|
||||||
anchors.fill: icon
|
|
||||||
horizontalOffset: 0
|
|
||||||
verticalOffset: 0
|
|
||||||
radius: 8.0
|
|
||||||
samples: 17
|
|
||||||
color: "#80000000"
|
|
||||||
source: icon
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
icon.grabToImage((img) => {
|
|
||||||
rect.color = ColourAverage.averageColour(img.image)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PropertyAnimation {
|
|
||||||
target: background
|
|
||||||
duration: units.longDuration
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
properties: "scale"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -24,9 +24,11 @@ import org.kde.plasma.plasmoid 2.0
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||||
import org.kde.kquickcontrolsaddons 2.0
|
import org.kde.kquickcontrolsaddons 2.0
|
||||||
|
import org.kde.kirigami 2.10 as Kirigami
|
||||||
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager
|
import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager
|
||||||
|
|
||||||
|
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
|
||||||
|
|
||||||
import org.kde.phone.homescreen 1.0
|
import org.kde.phone.homescreen 1.0
|
||||||
|
|
||||||
LauncherContainer {
|
LauncherContainer {
|
||||||
|
|
@ -70,16 +72,25 @@ LauncherContainer {
|
||||||
to: 3
|
to: 3
|
||||||
duration: 200
|
duration: 200
|
||||||
}
|
}
|
||||||
}
|
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: {
|
script: {
|
||||||
feedbackWindow.title = effect.title
|
effect.grabToImage((img) => {
|
||||||
feedbackWindow.icon = effect.source
|
NanoShell.StartupFeedback.open(
|
||||||
feedbackWindow.state = "open"
|
effect.source,
|
||||||
effect.visible = false
|
effect.title,
|
||||||
|
ColourAverage.averageColour(img.image),
|
||||||
|
effect.Kirigami.ScenePosition.x,
|
||||||
|
effect.Kirigami.ScenePosition.y,
|
||||||
|
effect.width,
|
||||||
|
effect.height);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ScriptAction {
|
||||||
|
script: effect.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function swoosh(x, y, sauce, title) {
|
function swoosh(x, y, sauce, title) {
|
||||||
effect.x = x
|
effect.x = x
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedbackWindow {
|
|
||||||
id: feedbackWindow
|
|
||||||
}
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
id: clickFedbackAnimation
|
id: clickFedbackAnimation
|
||||||
property Item target
|
property Item target
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue