1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-30 14:50:12 +03:00

delay window removal when closing from context menu

This commit is contained in:
Michail Vourlakos 2017-08-02 11:42:09 +03:00
parent ad0a66804f
commit ac3058c777
2 changed files with 23 additions and 1 deletions

View File

@ -782,7 +782,14 @@ PlasmaComponents.ContextMenu {
text: i18n("Close")
icon: "window-close"
onClicked: tasksModel.requestClose(menu.modelIndex)
onClicked: {
if (root.zoomFactor>1) {
delayWindowRemovalTimer.modelIndex = menu.modelIndex;
delayWindowRemovalTimer.start();
} else {
tasksModel.requestClose(menu.modelIndex);
}
}
}
PlasmaComponents.MenuItem {

View File

@ -445,6 +445,21 @@ Item {
}
}
//! Timer to delay the removal of the window through the context menu in case the
//! the window is zoomed
Timer{
id: delayWindowRemovalTimer
//this is the animation time needed in order for tasks to restore their zoom first
interval: 7 * (root.durationTime * units.shortDuration)
property var modelIndex
onTriggered: {
tasksModel.requestClose(delayWindowRemovalTimer.modelIndex)
}
}
/////Window Previews/////////