diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-12-02 11:56:33 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-12-02 13:37:55 +0100 |
commit | 7c6f5f874774ffb97657a3101e4ce17a4ef7f113 (patch) | |
tree | 8e8840137d7fcc425df0bf8e944d0a4161c33caa | |
parent | 18bf642733b98d20756ed4d42b962bd822aab74f (diff) |
Respect selectByMouse property of inputItem when in fullscreen mode
Before this patch, there was no way to control selectByMouse behavior
for the full screen shadow input item. This patch makes it follow
the value of the input item that caused the keyboard to open.
Change-Id: Ia22ba275a605340c9d64f60eefd242453ba9769c
Fixes: QTBUG-79617
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/virtualkeyboard/content/components/ShadowInputControl.qml | 2 | ||||
-rw-r--r-- | tests/auto/inputpanel/data/tst_inputpanel.qml | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/virtualkeyboard/content/components/ShadowInputControl.qml b/src/virtualkeyboard/content/components/ShadowInputControl.qml index a059c40e..95c1c97c 100644 --- a/src/virtualkeyboard/content/components/ShadowInputControl.qml +++ b/src/virtualkeyboard/content/components/ShadowInputControl.qml @@ -88,7 +88,7 @@ Item { selectionColor: keyboard.style.fullScreenInputSelectionColor selectedTextColor: keyboard.style.fullScreenInputSelectedTextColor echoMode: (InputContext.inputMethodHints & Qt.ImhHiddenText) ? TextInput.Password : TextInput.Normal - selectByMouse: true + selectByMouse: !!InputContext.inputItem.selectByMouse onCursorPositionChanged: { cursorSyncTimer.restart() blinkStatus = true diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 44a718c0..a81341f4 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -104,6 +104,7 @@ Rectangle { textInput.text = "" } textInput.inputMethodHints = data !== undefined && data.hasOwnProperty("initInputMethodHints") ? data.initInputMethodHints : Qt.ImhNone + textInput.selectByMouse = false handwritingInputPanel.available = false inputPanel.setHandwritingMode(false) textInput.forceActiveFocus() @@ -2078,6 +2079,18 @@ Rectangle { compare(inputPanel.shadowInput.text, "") } + function test_fullScreenModeSelectByMouse() { + prepareTest() + + inputPanel.setFullScreenMode(true) + + // The default value for TextInput/TextEdit is false. + compare(inputPanel.shadowInput.selectByMouse, false) + + textInput.selectByMouse = true + compare(inputPanel.shadowInput.selectByMouse, true) + } + function test_userDictionary_data() { return [ { inputSequence: ['a','s','d','f'], initShift: false }, |