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));
|
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: {
|
onShowPanelChanged: {
|
||||||
if (showPanel) {
|
if (showPanel) {
|
||||||
|
_hideTimer.stop();
|
||||||
_updatePosition();
|
_updatePosition();
|
||||||
_winVisible = true;
|
_winVisible = true;
|
||||||
hideAnim.stop();
|
hideAnim.stop();
|
||||||
showAnim.start();
|
showAnim.start();
|
||||||
} else {
|
} else {
|
||||||
showAnim.stop();
|
_hideTimer.restart();
|
||||||
hideAnim.start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue