centralize panel content-change grace period into HoverPanel.keepOpen()
This commit is contained in:
parent
084ef1da75
commit
46f14d5d36
6 changed files with 36 additions and 19 deletions
|
|
@ -92,6 +92,24 @@ PanelWindow {
|
|||
}
|
||||
}
|
||||
|
||||
// Content-change grace: call keepOpen(ms) when panel content is about to
|
||||
// resize/rebuild (session switch, device list change, etc.) to prevent the
|
||||
// hover-drop-on-resize from closing the panel.
|
||||
property bool _contentBusy: false
|
||||
Timer {
|
||||
id: _contentBusyTimer
|
||||
onTriggered: {
|
||||
root._contentBusy = false;
|
||||
if (!root.showPanel && !root._grace && !root._pinned)
|
||||
root._hideTimer.restart();
|
||||
}
|
||||
}
|
||||
function keepOpen(ms) {
|
||||
_contentBusy = true;
|
||||
_contentBusyTimer.interval = ms ?? 400;
|
||||
_contentBusyTimer.restart();
|
||||
}
|
||||
|
||||
function _show() {
|
||||
_updatePosition();
|
||||
_winVisible = true;
|
||||
|
|
@ -115,7 +133,7 @@ PanelWindow {
|
|||
Timer {
|
||||
id: _hideTimer
|
||||
interval: 150
|
||||
onTriggered: if (!root.showPanel && !root._grace && !root._pinned)
|
||||
onTriggered: if (!root.showPanel && !root._grace && !root._pinned && !root._contentBusy)
|
||||
root.dismiss()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue