1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-19 01:25:21 -04:00

fix(clipboard): paste selected history entry (#2660)

This commit is contained in:
jbwfu
2026-06-18 12:57:07 +08:00
committed by GitHub
parent 085ce01da6
commit b925010cb3
6 changed files with 74 additions and 8 deletions
@@ -45,8 +45,22 @@ DankModal {
});
}
function releaseTextInputFocus() {
contentLoader.item?.releaseTextInputFocus();
}
function hide() {
close();
releaseTextInputFocus();
Qt.callLater(function () {
clipboardHistoryModal.close();
});
}
function instantHide() {
releaseTextInputFocus();
Qt.callLater(function () {
clipboardHistoryModal.instantClose();
});
}
onDialogClosed: {
@@ -68,6 +82,11 @@ DankModal {
enableShadow: true
closeOnEscapeKey: (contentLoader.item?.mode ?? "history") !== "editor"
onBackgroundClicked: hide()
onShouldBeVisibleChanged: {
if (!shouldBeVisible) {
releaseTextInputFocus();
}
}
Ref {
service: ClipboardService
@@ -112,7 +131,7 @@ DankModal {
ClipboardHistoryContent {
clearConfirmDialog: clearConfirmDialog
onCloseRequested: clipboardHistoryModal.hide()
onInstantCloseRequested: clipboardHistoryModal.instantClose()
onInstantCloseRequested: clipboardHistoryModal.instantHide()
}
}
}