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

Enhance/clipboard history interactions (#2668)

* feat(clipboard): add entry context menu

* feat(clipboard): add click to paste option

* feat(clipboard): add optional copy and paste action buttons

* fix(clipboard): default selection and esc behavior

* fix(clipboard): prevent clear and filter overlap

* Update to remove dead kb nav & add escape action on context menu

---------

Co-authored-by: purian23 <purian23@gmail.com>
This commit is contained in:
jbwfu
2026-06-21 15:50:51 +08:00
committed by GitHub
parent 465cf7355b
commit 59fd6db83e
13 changed files with 570 additions and 19 deletions
@@ -8,6 +8,7 @@ FocusScope {
id: root
property var clearConfirmDialog: null
property var surfaceHost: null
property string activeTab: "recents"
property bool showKeyboardHints: false
@@ -32,6 +33,11 @@ FocusScope {
property alias searchField: historyContent.searchField
property alias editorView: editorView
property alias keyboardController: keyboardController
readonly property alias contextMenuActive: historyContent.contextMenuActive
function closeContextMenu() {
historyContent.closeContextMenu();
}
signal closeRequested
signal instantCloseRequested
@@ -42,7 +48,7 @@ FocusScope {
return;
}
ClipboardService.selectedIndex = 0;
ClipboardService.keyboardNavigationActive = false;
ClipboardService.keyboardNavigationActive = true;
}
onPinnedCountChanged: {
if (activeTab === "saved" && pinnedCount === 0) {
@@ -54,7 +60,7 @@ FocusScope {
onActiveFilterChanged: {
ClipboardService.activeFilter = activeFilter;
ClipboardService.selectedIndex = 0;
ClipboardService.keyboardNavigationActive = false;
ClipboardService.keyboardNavigationActive = true;
ClipboardService.updateFilteredModel();
if (SettingsData.clipboardRememberTypeFilter) {
SettingsData.set("clipboardTypeFilter", activeFilter);
@@ -92,6 +98,10 @@ FocusScope {
ClipboardService.pasteEntry(entry, () => root.requestClose(true));
}
function pasteEntry(entry) {
ClipboardService.pasteEntry(entry, () => root.requestClose(true));
}
function copyEntry(entry) {
ClipboardService.copyEntry(entry, () => root.requestClose(false));
}
@@ -159,6 +169,7 @@ FocusScope {
function resetState() {
activeImageLoads = 0;
mode = "history";
historyContent.closeContextMenu();
historyContent.closeFilterMenu();
activeFilter = SettingsData.clipboardRememberTypeFilter ? SettingsData.clipboardTypeFilter : "all";
ClipboardService.reset();