minimize animations

This commit is contained in:
Marco Martin 2020-07-28 12:30:13 +02:00
parent 93e16a9ca1
commit 5881d6be92
2 changed files with 22 additions and 2 deletions

View file

@ -38,13 +38,27 @@ Item {
}
}
function syncDelegateGeometry() {
let pos = delegate.mapToItem(tasksView, 0, 0);
if (window.visible) {
tasksModel.requestPublishDelegateGeometry(tasksModel.index(model.index, 0), Qt.rect(pos.x, pos.y, delegate.width, delegate.height), delegate);
} else {
tasksModel.requestPublishDelegateGeometry(tasksModel.index(model.index, 0), Qt.rect(pos.x, pos.y, delegate.width, delegate.height), dummyWindowTask);
}
}
Connections {
target: tasksView
onContentYChanged: {
var pos = delegate.mapToItem(tasksView, 0, 0);
tasksModel.requestPublishDelegateGeometry(tasksModel.index(model.index, 0), Qt.rect(pos.x, pos.y, delegate.width, delegate.height));
syncDelegateGeometry();
}
}
Connections {
target: window
function onVisibleChanged() {
syncDelegateGeometry();
}
}
Component.onCompleted: syncDelegateGeometry();
Item {
anchors {

View file

@ -271,4 +271,10 @@ PlasmaCore.ColorScope {
}
}
}
//This is to give an animation when the plasma button is pressed
Item {
id: dummyWindowTask
width: Screen.width
height: Screen.height
}
}