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:
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…
x
Reference in New Issue
Block a user