mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
nimations in favorites bar drag
This commit is contained in:
parent
1efb009b5e
commit
c036b12f7b
2 changed files with 26 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ Item {
|
||||||
|
|
||||||
property var modelData: model
|
property var modelData: model
|
||||||
|
|
||||||
opacity: root.reorderingApps && delegateRoot.GridView.view.dragData && delegateRoot.GridView.view.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole ? 0.3 : 1
|
opacity: delegateRoot != dragDelegate && root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole == modelData.ApplicationStorageIdRole ? 0.3 : 1
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
@ -18,7 +18,7 @@ Item {
|
||||||
width: parent.height / 2
|
width: parent.height / 2
|
||||||
height: width
|
height: width
|
||||||
source: modelData.ApplicationIconRole
|
source: modelData.ApplicationIconRole
|
||||||
scale: root.reorderingApps && delegateRoot.GridView.view.dragData && delegateRoot.GridView.view.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1
|
scale: root.reorderingApps && applicationsView.dragData && applicationsView.dragData.ApplicationStorageIdRole != modelData.ApplicationStorageIdRole ? 0.6 : 1
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: units.longDuration
|
duration: units.longDuration
|
||||||
|
|
|
||||||
|
|
@ -223,11 +223,19 @@ MouseEventListener {
|
||||||
scrollDownIndicator.opacity = 0;
|
scrollDownIndicator.opacity = 0;
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var pos = mapToItem(applicationsView.contentItem, mouse.x, mouse.y);
|
var pos = mapToItem(applicationsView.headerItem.favoritesStrip, mouse.x, mouse.y);
|
||||||
var item = applicationsView.itemAt(pos.x, pos.y)
|
//in favorites area?
|
||||||
|
var item;
|
||||||
|
if (applicationsView.headerItem.favoritesStrip.contains(pos)) {
|
||||||
|
item = applicationsView.headerItem.favoritesStrip.itemAt(pos.x, pos.y);
|
||||||
|
} else {
|
||||||
|
pos = mapToItem(applicationsView.contentItem, mouse.x, mouse.y);
|
||||||
|
item = applicationsView.itemAt(pos.x, pos.y)
|
||||||
|
}
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
appListModel.runApplication(item.modelData.ApplicationStorageIdRole)
|
appListModel.runApplication(item.modelData.ApplicationStorageIdRole)
|
||||||
}
|
}
|
||||||
PlasmaCore.ColorScope {
|
PlasmaCore.ColorScope {
|
||||||
|
|
@ -449,6 +457,20 @@ MouseEventListener {
|
||||||
model: appListModel
|
model: appListModel
|
||||||
delegate: HomeLauncher {}
|
delegate: HomeLauncher {}
|
||||||
|
|
||||||
|
move: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: units.longDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
properties: "x,y"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moveDisplaced: Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: units.longDuration
|
||||||
|
easing.type: Easing.InOutQuad
|
||||||
|
properties: "x,y"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue