delay window removal when closing from context menu

pull/1/head
Michail Vourlakos 8 years ago
parent ad0a66804f
commit ac3058c777

@ -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 {

@ -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/////////

Loading…
Cancel
Save