remove click feedback anim

This commit is contained in:
Marco Martin 2020-02-11 16:14:54 +01:00
parent 91c92f8fa1
commit ea01f911c5
3 changed files with 11 additions and 89 deletions

View file

@ -45,6 +45,7 @@ ContainmentLayoutManager.ItemContainer {
key: model.ApplicationStorageIdRole key: model.ApplicationStorageIdRole
property real dragCenterX property real dragCenterX
property real dragCenterY property real dragCenterY
property alias iconItem: icon
editModeCondition: ContainmentLayoutManager.ItemContainer.AfterPressAndHold editModeCondition: ContainmentLayoutManager.ItemContainer.AfterPressAndHold
@ -92,9 +93,6 @@ ContainmentLayoutManager.ItemContainer {
contentItem: MouseArea { contentItem: MouseArea {
onClicked: { onClicked: {
clickFedbackAnimation.target = delegate;
clickFedbackAnimation.running = true;
delegate.launch(delegate.x + (units.smallSpacing * 2), delegate.y + (units.smallSpacing * 2), icon.source, modelData.ApplicationNameRole) delegate.launch(delegate.x + (units.smallSpacing * 2), delegate.y + (units.smallSpacing * 2), icon.source, modelData.ApplicationNameRole)
plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole); plasmoid.nativeInterface.applicationListModel.runApplication(modelData.ApplicationStorageIdRole);

View file

@ -41,67 +41,6 @@ LauncherContainer {
frame.width: width frame.width: width
PlasmaCore.IconItem {
id: effect
height: 64
width: 64
visible: false
x: 0
y: 0
source: "pattern-kde"
property string title
SequentialAnimation {
id: woosh
ScriptAction {
script: effect.visible = true
}
ParallelAnimation {
NumberAnimation {
target: effect
property: "opacity"
from: 0.9
to: 0
duration: 200
}
NumberAnimation {
target: effect
property: "scale"
from: 1
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: effect.visible = false
}
}
function swoosh(x, y, sauce, title) {
effect.x = x
effect.y = y
effect.source = sauce
effect.visible = true
effect.title = title
woosh.restart()
}
}
Repeater { Repeater {
parent: root.flow parent: root.flow
model: plasmoid.nativeInterface.applicationListModel model: plasmoid.nativeInterface.applicationListModel
@ -126,9 +65,16 @@ LauncherContainer {
appletsLayout.restoreItem(delegate); appletsLayout.restoreItem(delegate);
} }
} }
onLaunch: (a, b, c, d) => { onLaunch: (x, y, icon, title) => {
print(a,b,c,d) delegate.grabToImage((img) => {
effect.swoosh(a, b, c, d) NanoShell.StartupFeedback.open(
icon,
title,
ColourAverage.averageColour(img.image),
delegate.iconItem.Kirigami.ScenePosition.x + delegate.iconItem.width/2,
delegate.iconItem.Kirigami.ScenePosition.y + delegate.iconItem.height/2,
Math.min(delegate.iconItem.width, delegate.iconItem.height));
});
} }
onParentFromLocationChanged: { onParentFromLocationChanged: {
if (!launcherDragManager.active && parent != parentFromLocation) { if (!launcherDragManager.active && parent != parentFromLocation) {

View file

@ -101,28 +101,6 @@ Item {
} }
} }
SequentialAnimation {
id: clickFedbackAnimation
property Item target
NumberAnimation {
target: clickFedbackAnimation.target
properties: "scale"
to: 2
duration: units.longDuration
easing.type: Easing.InOutQuad
}
PauseAnimation {
duration: units.shortDuration
}
NumberAnimation {
target: clickFedbackAnimation.target
properties: "scale"
to: 1
duration: units.longDuration
easing.type: Easing.InOutQuad
}
}
Launcher.LauncherDragManager { Launcher.LauncherDragManager {
id: launcherDragManager id: launcherDragManager
anchors.fill: parent anchors.fill: parent