From 91c92f8fa1f5194a646df98dfeb5beb3d90ebe95 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 11 Feb 2020 13:57:34 +0100 Subject: [PATCH] remove local feedbackWindow --- .../package/contents/ui/FeedbackWindow.qml | 128 ------------------ .../contents/ui/launcher/LauncherGrid.qml | 25 +++- .../homescreen/package/contents/ui/main.qml | 3 - 3 files changed, 18 insertions(+), 138 deletions(-) delete mode 100644 containments/homescreen/package/contents/ui/FeedbackWindow.qml diff --git a/containments/homescreen/package/contents/ui/FeedbackWindow.qml b/containments/homescreen/package/contents/ui/FeedbackWindow.qml deleted file mode 100644 index f5b3c3c6..00000000 --- a/containments/homescreen/package/contents/ui/FeedbackWindow.qml +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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 -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" - } - } - } - ] - } -} diff --git a/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml b/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml index 5d191b0c..308ba542 100644 --- a/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml +++ b/containments/homescreen/package/contents/ui/launcher/LauncherGrid.qml @@ -24,9 +24,11 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents 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.nanoshell 2.0 as NanoShell + import org.kde.phone.homescreen 1.0 LauncherContainer { @@ -70,14 +72,23 @@ LauncherContainer { to: 3 duration: 200 } + ScriptAction { + script: { + effect.grabToImage((img) => { + NanoShell.StartupFeedback.open( + effect.source, + effect.title, + ColourAverage.averageColour(img.image), + effect.Kirigami.ScenePosition.x, + effect.Kirigami.ScenePosition.y, + effect.width, + effect.height); + }) + } + } } ScriptAction { - script: { - feedbackWindow.title = effect.title - feedbackWindow.icon = effect.source - feedbackWindow.state = "open" - effect.visible = false - } + script: effect.visible = false } } diff --git a/containments/homescreen/package/contents/ui/main.qml b/containments/homescreen/package/contents/ui/main.qml index 920121ae..cbd0201b 100644 --- a/containments/homescreen/package/contents/ui/main.qml +++ b/containments/homescreen/package/contents/ui/main.qml @@ -101,9 +101,6 @@ Item { } } - FeedbackWindow { - id: feedbackWindow - } SequentialAnimation { id: clickFedbackAnimation property Item target