summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-10-27 11:13:36 +0100
committerRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-10-27 16:09:45 +0100
commit38b908abbe8acbcb8ccff1f1e6cc2781b182a1f3 (patch)
treeb6b5dfd28f3d0588be84a44507ad906d7a6c34c3
parent19a1de32e68389147566ab7d51df47946511d847 (diff)
downloadqtquickcontrols-38b908abbe8acbcb8ccff1f1e6cc2781b182a1f3.tar.gz
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.qml4
-rw-r--r--src/controls/TextArea.qml4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/controls/Private/TextInputWithHandles.qml b/src/controls/Private/TextInputWithHandles.qml
index 5ca81aa1..2ba6d693 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 844cbff1..873417dc 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()