fix hover panel hide race with 50ms debounce
This commit is contained in:
parent
cce695a8c6
commit
55627bc157
1 changed files with 13 additions and 2 deletions
|
|
@ -50,15 +50,26 @@ PanelWindow {
|
|||
margins.left = Math.max(0, Math.min(Math.round(pt.x - (scr?.x ?? 0) - contentWidth / 2), sw - contentWidth));
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: _hideTimer
|
||||
interval: 50
|
||||
onTriggered: {
|
||||
if (!root.showPanel) {
|
||||
showAnim.stop();
|
||||
hideAnim.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onShowPanelChanged: {
|
||||
if (showPanel) {
|
||||
_hideTimer.stop();
|
||||
_updatePosition();
|
||||
_winVisible = true;
|
||||
hideAnim.stop();
|
||||
showAnim.start();
|
||||
} else {
|
||||
showAnim.stop();
|
||||
hideAnim.start();
|
||||
_hideTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue