diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2016-12-18 19:46:52 +0200 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2016-12-19 18:58:40 +0000 |
commit | 8ce9006f21bc2d6a0f703ebdb7cfe92cfeeb9c5e (patch) | |
tree | 1430ab14317105219dd73aa66c603e0f9fbcf935 | |
parent | 25dfc588ac541be99a490ea9a76cc38660504fd2 (diff) |
Use uppercase property
Since we now have InputCase.uppercase property, use it instead of
InputContext.shift where appropriate.
By using the uppercase property, we ensure any future modification
to ShiftHandler does not break uppercase handling.
The uppercase property is true when either shift or capsLock properties
are true.
Change-Id: I5bdd4431f66619ac944f70273a0a89ba4c750026
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
4 files changed, 5 insertions, 5 deletions
diff --git a/src/virtualkeyboard/content/components/AlternativeKeys.qml b/src/virtualkeyboard/content/components/AlternativeKeys.qml index 48b8643f..a1fcfe14 100644 --- a/src/virtualkeyboard/content/components/AlternativeKeys.qml +++ b/src/virtualkeyboard/content/components/AlternativeKeys.qml @@ -85,7 +85,7 @@ Item { if (active && listView.currentIndex >= 0 && listView.currentIndex < listView.model.count) { var activeKey = listView.model.get(listView.currentIndex) InputContext.inputEngine.virtualKeyClick(keyCode, activeKey.text, - InputContext.shift ? Qt.ShiftModifier : 0) + InputContext.uppercase ? Qt.ShiftModifier : 0) } } @@ -94,7 +94,7 @@ Item { var alternativeKeys = key.effectiveAlternativeKeys if (alternativeKeys.length > 0) { for (var i = 0; i < alternativeKeys.length; i++) { - listModel.append({ "text": InputContext.shift ? alternativeKeys[i].toUpperCase() : alternativeKeys[i] }) + listModel.append({ "text": InputContext.uppercase ? alternativeKeys[i].toUpperCase() : alternativeKeys[i] }) } listView.width = keyboard.style.alternateKeysListItemWidth * listModel.count listView.forceLayout() diff --git a/src/virtualkeyboard/content/components/BaseKey.qml b/src/virtualkeyboard/content/components/BaseKey.qml index 578fcd21..5c686adf 100644 --- a/src/virtualkeyboard/content/components/BaseKey.qml +++ b/src/virtualkeyboard/content/components/BaseKey.qml @@ -204,7 +204,7 @@ Item { By default, this property reflects the uppercase status of the keyboard. */ - property bool uppercased: InputContext.shift && !noModifier + property bool uppercased: InputContext.uppercase && !noModifier /*! Sets the key panel delegate for the key. diff --git a/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml b/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml index b2f42c05..1f9a05a2 100644 --- a/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml +++ b/src/virtualkeyboard/content/components/CharacterPreviewBubble.qml @@ -45,7 +45,7 @@ Item { onActiveKeyChanged: { if (activeKey && characterPreview.item !== null) { - characterPreview.item.text = InputContext.shift ? activeKey.text.toUpperCase() : activeKey.text + characterPreview.item.text = InputContext.uppercase ? activeKey.text.toUpperCase() : activeKey.text width = activeKey.width height = activeKey.height var position = keyboard.mapFromItem(activeKey, 0, 0) diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml index f948f303..bd4ea193 100644 --- a/src/virtualkeyboard/content/components/Keyboard.qml +++ b/src/virtualkeyboard/content/components/Keyboard.qml @@ -634,7 +634,7 @@ Item { function click(key) { if (key && key.enabled) { if (!key.noKeyEvent) - InputContext.inputEngine.virtualKeyClick(key.key, InputContext.shift ? key.text.toUpperCase() : key.text, InputContext.shift ? Qt.ShiftModifier : 0) + InputContext.inputEngine.virtualKeyClick(key.key, InputContext.uppercase ? key.text.toUpperCase() : key.text, InputContext.uppercase ? Qt.ShiftModifier : 0) key.clicked() } } |