1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-20 18:15:24 -04:00

Fix/clipboard confirmation keyboard safety (#2623)

* fix(clipboard): improve confirmation dialog keyboard focus

* fix(clipboard): require confirmation for clear-all shortcut
This commit is contained in:
jbwfu
2026-06-12 23:34:16 +08:00
committed by GitHub
parent d53809cf2b
commit 0f2f4b96c4
5 changed files with 57 additions and 15 deletions
@@ -82,6 +82,15 @@ FocusScope {
ClipboardService.clearAll();
}
function confirmClearAll() {
const hasPinned = pinnedCount > 0;
const message = hasPinned ? I18n.tr("This will delete all unpinned entries. %1 pinned entries will be kept.").arg(pinnedCount) : I18n.tr("This will permanently delete all clipboard history.");
clearConfirmDialog.show(I18n.tr("Clear History?"), message, function () {
clearAll();
hide();
}, function () {});
}
function getEntryPreview(entry) {
return ClipboardService.getEntryPreview(entry);
}
@@ -135,7 +144,6 @@ FocusScope {
id: historyContent
anchors.fill: parent
modal: root
clearConfirmDialog: root.clearConfirmDialog
}
}