mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 17:24:01 -04:00
colorpicker/popout: add instant-close machinery for eye dropper
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user