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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user