diff --git a/src/gui/Base/HTextArea.qml b/src/gui/Base/HTextArea.qml index 01cd240b..949239ec 100644 --- a/src/gui/Base/HTextArea.qml +++ b/src/gui/Base/HTextArea.qml @@ -107,6 +107,9 @@ TextArea { previousDefaultText = defaultText } + onPressed: ev => { if (ev.button === Qt.RightButton) contextMenu.spawn() } + onPressAndHold: ev => contextMenu.spawn() + Keys.onPressed: ev => { // Prevent alt/super+any key from typing text if ( @@ -181,17 +184,6 @@ TextArea { Behavior on opacity { HNumberAnimation {} } } - TapHandler { - acceptedButtons: Qt.RightButton - acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen - onTapped: contextMenu.spawn() - } - - TapHandler { - acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen - onLongPressed: contextMenu.spawn() - } - HTextContextMenu { id: contextMenu enableCustomImagePaste: textArea.enableCustomImagePaste diff --git a/src/gui/Base/HTextField.qml b/src/gui/Base/HTextField.qml index 65f698fc..d7605ea5 100644 --- a/src/gui/Base/HTextField.qml +++ b/src/gui/Base/HTextField.qml @@ -87,6 +87,9 @@ TextField { previousDefaultText = defaultText } + onPressed: ev => { if (ev.button === Qt.RightButton) contextMenu.spawn() } + onPressAndHold: ev => contextMenu.spawn() + // Prevent alt/super+any key from typing text Keys.onPressed: if ( event.modifiers & Qt.AltModifier || @@ -146,16 +149,5 @@ TextField { Behavior on opacity { HNumberAnimation {} } } - TapHandler { - acceptedButtons: Qt.RightButton - acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen - onTapped: contextMenu.spawn() - } - - TapHandler { - acceptedPointerTypes: PointerDevice.Finger | PointerDevice.Pen - onLongPressed: contextMenu.spawn() - } - HTextContextMenu { id: contextMenu } }