colorpicker/popout: add instant-close machinery for eye dropper

This commit is contained in:
bbedward
2026-09-03 12:51:15 -04:00
parent ea0b3159dd
commit 6a4ce613bb
4 changed files with 38 additions and 2 deletions
@@ -20,7 +20,7 @@ DankPopout {
anchors.fill: parent
initialColor: SessionData.recentColors.length > 0 ? SessionData.recentColors[0] : Theme.primary
onCloseRequested: root.close()
onHideRequested: root.close()
onHideRequested: root.instantClose()
onShowRequested: root.open()
}
}
+9 -1
View File
@@ -169,11 +169,19 @@ Item {
}
function close() {
_close(false);
}
function instantClose() {
_close(true);
}
function _close(instant) {
_pendingOpen = false;
_pendingOpenTimer.stop();
transientSurfaceTracker?.closeAll?.();
if (impl.item) {
impl.item.close();
instant ? impl.item.instantClose() : impl.item.close();
return;
}
PopoutManager.hidePopout(root);
@@ -520,6 +520,21 @@ Item {
closeTimer.restart();
}
function instantClose() {
closeTimer.stop();
_endMorphTravel();
_resetPublishedBody();
animationsEnabled = false;
isClosing = false;
shouldBeVisible = false;
_keyboardReady = false;
_primeContent = false;
contentWindow.visible = false;
PopoutManager.hidePopout(popoutHandle);
popoutClosed();
Qt.callLater(() => animationsEnabled = true);
}
function toggle() {
shouldBeVisible ? close() : open();
}
@@ -395,6 +395,19 @@ Item {
closeTimer.restart();
}
function instantClose() {
closeTimer.stop();
animationsEnabled = false;
isClosing = false;
shouldBeVisible = false;
_primeContent = false;
contentWindow.visible = false;
backgroundWindow.visible = false;
PopoutManager.hidePopout(popoutHandle);
popoutClosed();
Qt.callLater(() => animationsEnabled = true);
}
function toggle() {
shouldBeVisible ? close() : open();
}