From c63d5ea3cdf5e9cbef319fd48101189fc658f05e Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 15 Nov 2024 12:24:29 +0800 Subject: [PATCH] chore: edit contextMenu item enable tweak - only echoMode Normal enable `copy` and `cut` - readonly disable `cut` --- qt6/src/qml/TextField.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/TextField.qml b/qt6/src/qml/TextField.qml index c2a8c536..47985026 100644 --- a/qt6/src/qml/TextField.qml +++ b/qt6/src/qml/TextField.qml @@ -77,14 +77,14 @@ T.TextField { { text: qsTr("Copy") onTriggered: control.copy() - enabled: control.selectedText.length + enabled: control.selectedText.length && control.echoMode === TextInput.Normal } MenuItem { text: qsTr("Cut") onTriggered: control.cut() - enabled: control.selectedText.length + enabled: !control.readonly && control.selectedText.length && control.echoMode === TextInput.Normal } MenuItem