From aed731efb0976909ca1425db06d8302abec8b5b9 Mon Sep 17 00:00:00 2001 From: purian23 Date: Mon, 25 May 2026 23:19:42 -0400 Subject: [PATCH] fix(clipboard): restore Save button targets in editor --- .../Modals/Clipboard/ClipboardEditor.qml | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/quickshell/Modals/Clipboard/ClipboardEditor.qml b/quickshell/Modals/Clipboard/ClipboardEditor.qml index e39c750d..552343e5 100644 --- a/quickshell/Modals/Clipboard/ClipboardEditor.qml +++ b/quickshell/Modals/Clipboard/ClipboardEditor.qml @@ -139,12 +139,8 @@ Item { }); } - function toggleSaveMenu() { - if (saveMenu.visible) { - saveMenu.close(); - return; - } - saveMenu.open(); + function positionSaveMenu() { + saveMenu.width = Math.max(saveMenuColumn.implicitWidth + saveMenu.padding * 2, saveButton.width); const pos = saveButton.mapToItem(Overlay.overlay, 0, 0); const popupW = saveMenu.width; const popupH = saveMenu.height; @@ -164,6 +160,16 @@ Item { saveMenu.y = y; } + function toggleSaveMenu() { + if (saveMenu.visible) { + saveMenu.close(); + return; + } + saveMenu.open(); + positionSaveMenu(); + Qt.callLater(positionSaveMenu); + } + Shortcut { sequences: ["Escape"] enabled: modal.mode === "editor" @@ -304,9 +310,12 @@ Item { Item { id: saveButton - property int arrowWidth: Theme.iconSize + Theme.spacingS - width: cancelButton.implicitWidth - height: cancelButton.implicitHeight + + readonly property int buttonHeight: cancelButton.buttonHeight + readonly property int arrowWidth: Theme.iconSizeLarge + + width: cancelButton.width + height: buttonHeight Rectangle { anchors.fill: parent @@ -340,7 +349,7 @@ Item { Rectangle { width: 1 - height: parent.height - Theme.spacingM + height: parent.height - cancelButton.horizontalPadding color: Theme.withAlpha(Theme.onPrimary, 0.2) anchors.right: saveArrowArea.left anchors.verticalCenter: parent.verticalCenter @@ -354,12 +363,14 @@ Item { } StateLayer { + z: 1 anchors.fill: saveMainArea stateColor: Theme.onPrimary onClicked: root.saveEntry("history") } StateLayer { + z: 1 anchors.fill: saveArrowArea stateColor: Theme.onPrimary onClicked: root.toggleSaveMenu() @@ -370,9 +381,9 @@ Item { Popup { id: saveMenu parent: Overlay.overlay - width: saveMenuColumn.implicitWidth + padding * 2 padding: Theme.spacingM - modal: false + modal: true + dim: false focus: true closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside