summaryrefslogtreecommitdiff
path: root/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml
diff options
context:
space:
mode:
authornippy <you@example.com>2026-04-18 13:49:56 +0200
committernippy <you@example.com>2026-04-18 13:49:56 +0200
commit5d94c0a7d44a2255b81815a52a7056a94a39842d (patch)
tree759bdea9645c6a62f9e1e4c001f7d81cccd120d2 /raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml
parente79cdf210b267f21a186255ce1a4d50029439d54 (diff)
downloadRaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.tar.gz
RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.zip
update Raveos themes
Diffstat (limited to 'raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml')
-rw-r--r--raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml174
1 files changed, 174 insertions, 0 deletions
diff --git a/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml b/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml
new file mode 100644
index 0000000..2f76cc7
--- /dev/null
+++ b/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Modals/Clipboard/ClipboardHistoryModal.qml
@@ -0,0 +1,174 @@
+pragma ComponentBehavior: Bound
+
+import QtQuick
+import Quickshell.Hyprland
+import qs.Common
+import qs.Modals.Clipboard
+import qs.Modals.Common
+import qs.Services
+
+DankModal {
+ id: clipboardHistoryModal
+
+ layerNamespace: "dms:clipboard"
+
+ HyprlandFocusGrab {
+ windows: [clipboardHistoryModal.contentWindow]
+ active: clipboardHistoryModal.useHyprlandFocusGrab && clipboardHistoryModal.shouldHaveFocus
+ }
+
+ property string activeTab: "recents"
+ onActiveTabChanged: {
+ ClipboardService.selectedIndex = 0;
+ ClipboardService.keyboardNavigationActive = false;
+ }
+ property bool showKeyboardHints: false
+ property Component clipboardContent
+ property int activeImageLoads: 0
+ readonly property int maxConcurrentLoads: 3
+
+ readonly property bool clipboardAvailable: ClipboardService.clipboardAvailable
+ readonly property bool wtypeAvailable: ClipboardService.wtypeAvailable
+ readonly property int totalCount: ClipboardService.totalCount
+ readonly property var clipboardEntries: ClipboardService.clipboardEntries
+ readonly property var pinnedEntries: ClipboardService.pinnedEntries
+ readonly property int pinnedCount: ClipboardService.pinnedCount
+ readonly property var unpinnedEntries: ClipboardService.unpinnedEntries
+ readonly property int selectedIndex: ClipboardService.selectedIndex
+ readonly property bool keyboardNavigationActive: ClipboardService.keyboardNavigationActive
+ property string searchText: ClipboardService.searchText
+ onSearchTextChanged: ClipboardService.searchText = searchText
+
+ Ref {
+ service: ClipboardService
+ }
+
+ function updateFilteredModel() {
+ ClipboardService.updateFilteredModel();
+ }
+
+ function pasteSelected() {
+ ClipboardService.pasteSelected(instantClose);
+ }
+
+ function toggle() {
+ if (shouldBeVisible) {
+ hide();
+ } else {
+ show();
+ }
+ }
+
+ function show() {
+ open();
+ activeImageLoads = 0;
+ shouldHaveFocus = true;
+ ClipboardService.reset();
+ if (clipboardAvailable)
+ ClipboardService.refresh();
+ keyboardController.reset();
+
+ Qt.callLater(function () {
+ if (contentLoader.item?.searchField) {
+ contentLoader.item.searchField.text = "";
+ contentLoader.item.searchField.forceActiveFocus();
+ }
+ });
+ }
+
+ function hide() {
+ close();
+ }
+
+ onDialogClosed: {
+ activeImageLoads = 0;
+ ClipboardService.reset();
+ keyboardController.reset();
+ }
+
+ function refreshClipboard() {
+ ClipboardService.refresh();
+ }
+
+ function copyEntry(entry) {
+ ClipboardService.copyEntry(entry, hide);
+ }
+
+ function deleteEntry(entry) {
+ ClipboardService.deleteEntry(entry);
+ }
+
+ function deletePinnedEntry(entry) {
+ ClipboardService.deletePinnedEntry(entry, clearConfirmDialog);
+ }
+
+ function pinEntry(entry) {
+ ClipboardService.pinEntry(entry);
+ }
+
+ function unpinEntry(entry) {
+ ClipboardService.unpinEntry(entry);
+ }
+
+ function clearAll() {
+ ClipboardService.clearAll();
+ }
+
+ function getEntryPreview(entry) {
+ return ClipboardService.getEntryPreview(entry);
+ }
+
+ function getEntryType(entry) {
+ return ClipboardService.getEntryType(entry);
+ }
+
+ visible: false
+ modalWidth: ClipboardConstants.modalWidth
+ modalHeight: ClipboardConstants.modalHeight
+ backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
+ cornerRadius: Theme.cornerRadius
+ borderColor: Theme.outlineMedium
+ borderWidth: 1
+ enableShadow: true
+ onBackgroundClicked: hide()
+ modalFocusScope.Keys.onPressed: function (event) {
+ keyboardController.handleKey(event);
+ }
+ content: clipboardContent
+
+ ClipboardKeyboardController {
+ id: keyboardController
+ modal: clipboardHistoryModal
+ }
+
+ ConfirmModal {
+ id: clearConfirmDialog
+ confirmButtonText: I18n.tr("Clear All")
+ confirmButtonColor: Theme.primary
+ onVisibleChanged: {
+ if (visible) {
+ clipboardHistoryModal.shouldHaveFocus = false;
+ return;
+ }
+ Qt.callLater(function () {
+ if (!clipboardHistoryModal.shouldBeVisible) {
+ return;
+ }
+ clipboardHistoryModal.shouldHaveFocus = true;
+ clipboardHistoryModal.modalFocusScope.forceActiveFocus();
+ if (clipboardHistoryModal.contentLoader.item?.searchField) {
+ clipboardHistoryModal.contentLoader.item.searchField.forceActiveFocus();
+ }
+ });
+ }
+ }
+
+ property var confirmDialog: clearConfirmDialog
+
+ clipboardContent: Component {
+ ClipboardContent {
+ modal: clipboardHistoryModal
+ clearConfirmDialog: clipboardHistoryModal.confirmDialog
+ }
+ }
+}