1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-16 08:05:19 -04:00

feat(Clipboard): Revive ClipboardEditor PR

- Original PR #1916 by @nabaco
This commit is contained in:
purian23
2026-05-24 23:28:21 -04:00
parent e92da4a15f
commit cf0632c077
3 changed files with 533 additions and 489 deletions
@@ -66,12 +66,27 @@ QtObject {
}
}
function editSelected() {
const entries = modal.activeTab === "saved" ? ClipboardService.pinnedEntries : ClipboardService.unpinnedEntries;
if (!entries || entries.length === 0) {
return;
}
const index = ClipboardService.selectedIndex >= 0 && ClipboardService.selectedIndex < entries.length ? ClipboardService.selectedIndex : 0;
modal.editEntry(entries[index]);
}
function handleKey(event) {
if (modal.mode === "editor") {
if (event.key === Qt.Key_Escape) {
modal.mode = "history";
event.accepted = true;
}
return;
}
switch (event.key) {
case Qt.Key_Escape:
if (modal.mode === "editor") {
modal.mode = "history";
} else if (ClipboardService.keyboardNavigationActive) {
if (ClipboardService.keyboardNavigationActive) {
ClipboardService.keyboardNavigationActive = false;
} else {
modal.hide();
@@ -154,6 +169,10 @@ QtObject {
event.accepted = true;
}
return;
case Qt.Key_E:
editSelected();
event.accepted = true;
return;
}
}