mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
feedback when clicking on a launcher icon
This commit is contained in:
parent
f30d55186f
commit
9cd3635114
1 changed files with 29 additions and 3 deletions
|
|
@ -230,8 +230,10 @@ MouseEventListener {
|
||||||
dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight;
|
dragDelegate.xTarget = Math.floor(mouse.x / root.buttonHeight) * root.buttonHeight;
|
||||||
dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight;
|
dragDelegate.yTarget = Math.floor(mouse.y / root.buttonHeight) * root.buttonHeight;
|
||||||
dragDelegate.opacity = 0;
|
dragDelegate.opacity = 0;
|
||||||
|
if (dragDelegate.modelData) {
|
||||||
dragDelegate.modelData.ApplicationIconRole = "";
|
dragDelegate.modelData.ApplicationIconRole = "";
|
||||||
dragDelegate.modelDataChanged();
|
dragDelegate.modelDataChanged();
|
||||||
|
}
|
||||||
applicationsView.dragData = null;
|
applicationsView.dragData = null;
|
||||||
root.reorderingApps = false;
|
root.reorderingApps = false;
|
||||||
applicationsView.forceLayout();
|
applicationsView.forceLayout();
|
||||||
|
|
@ -241,6 +243,7 @@ MouseEventListener {
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
|
var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
|
||||||
|
|
||||||
//in favorites area?
|
//in favorites area?
|
||||||
var item;
|
var item;
|
||||||
if (applicationsView.headerItem.favoritesStrip.contains(pos)) {
|
if (applicationsView.headerItem.favoritesStrip.contains(pos)) {
|
||||||
|
|
@ -253,7 +256,30 @@ MouseEventListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
plasmoid.nativeInterface.applicationListModel.runApplication(item.modelData.ApplicationStorageIdRole)
|
plasmoid.nativeInterface.applicationListModel.runApplication(item.modelData.ApplicationStorageIdRole);
|
||||||
|
clickFedbackAnimation.target = item;
|
||||||
|
clickFedbackAnimation.running = true;
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PlasmaCore.ColorScope {
|
PlasmaCore.ColorScope {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue