diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-10-27 11:13:36 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-10-27 16:09:45 +0100 |
commit | 38b908abbe8acbcb8ccff1f1e6cc2781b182a1f3 (patch) | |
tree | b6b5dfd28f3d0588be84a44507ad906d7a6c34c3 | |
parent | 19a1de32e68389147566ab7d51df47946511d847 (diff) |
TextInput: disable activation logic when there is a menu assigned
The edit menu has it's own logic for when to show the menu, when
to activate the input field etc upon press/release/click. So if
there is a menu, don't interfere with its logic.
Change-Id: If6af1e7b8f6bc68c66836846969cfe6bcee56de4
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r-- | src/controls/Private/TextInputWithHandles.qml | 4 | ||||
-rw-r--r-- | src/controls/TextArea.qml | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/controls/Private/TextInputWithHandles.qml b/src/controls/Private/TextInputWithHandles.qml index 5ca81aa15..2ba6d6931 100644 --- a/src/controls/Private/TextInputWithHandles.qml +++ b/src/controls/Private/TextInputWithHandles.qml @@ -106,11 +106,15 @@ TextInput { cursorShape: Qt.IBeamCursor acceptedButtons: (input.selectByMouse ? Qt.NoButton : Qt.LeftButton) | (control.menu ? Qt.RightButton : Qt.NoButton) onClicked: { + if (editMenu.source) + return; var pos = input.positionAt(mouse.x, mouse.y) input.moveHandles(pos, pos) input.activate() } onPressAndHold: { + if (editMenu.source) + return; var pos = input.positionAt(mouse.x, mouse.y) input.moveHandles(pos, control.selectByMouse ? -1 : pos) input.activate() diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml index 844cbff11..873417dc1 100644 --- a/src/controls/TextArea.qml +++ b/src/controls/TextArea.qml @@ -851,11 +851,15 @@ ScrollView { cursorShape: edit.hoveredLink ? Qt.PointingHandCursor : Qt.IBeamCursor acceptedButtons: (edit.selectByMouse ? Qt.NoButton : Qt.LeftButton) | (area.menu ? Qt.RightButton : Qt.NoButton) onClicked: { + if (editMenu.source) + return; var pos = edit.positionAt(mouse.x, mouse.y) edit.moveHandles(pos, pos) edit.activate() } onPressAndHold: { + if (editMenu.source) + return; var pos = edit.positionAt(mouse.x, mouse.y) edit.moveHandles(pos, area.selectByMouse ? -1 : pos) edit.activate() |