Skip to content

Commit

Permalink
chore: edit contextMenu item enable tweak
Browse files Browse the repository at this point in the history
- only echoMode Normal enable `copy` and `cut`
- readonly disable `cut`
  • Loading branch information
kegechen committed Nov 15, 2024
1 parent c4dc4d2 commit c63d5ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qt6/src/qml/TextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c63d5ea

Please sign in to comment.