Merge lp:~zsombi/ubuntu-ui-toolkit/textinputs-osk-fix into lp:ubuntu-ui-toolkit

Proposed by Zsombor Egri
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 359
Merged at revision: 359
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/textinputs-osk-fix
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 89 lines (+23/-6)
2 files modified
modules/Ubuntu/Components/TextArea.qml (+15/-2)
modules/Ubuntu/Components/TextField.qml (+8/-4)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/textinputs-osk-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+148639@code.launchpad.net

Commit message

Text inputs (TextField and TextArea) bring up hidden OSK when focused.

Description of the change

Text inputs (TextField and TextArea) bring up hidden OSK when focused.

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks and works good :-)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/TextArea.qml'
2--- modules/Ubuntu/Components/TextArea.qml 2013-02-13 15:40:45 +0000
3+++ modules/Ubuntu/Components/TextArea.qml 2013-02-15 09:29:57 +0000
4@@ -658,6 +658,15 @@
5 editor.undo();
6 }
7
8+ /*!
9+ \internal
10+ Ensure focus propagation
11+ */
12+ function forceActiveFocus()
13+ {
14+ internal.activateEditor();
15+ }
16+
17 // logic
18 /*!\internal - to remove warnings */
19 Component.onCompleted: {
20@@ -733,12 +742,16 @@
21 function activateEditor()
22 {
23 if (!control.activeFocus)
24- control.forceActiveFocus();
25+ editor.forceActiveFocus();
26+ else
27+ showInputPanel();
28+
29 }
30
31 function showInputPanel()
32 {
33- Qt.inputMethod.show();
34+ if (!Qt.inputMethod.visible)
35+ Qt.inputMethod.show();
36 }
37 function hideInputPanel()
38 {
39
40=== modified file 'modules/Ubuntu/Components/TextField.qml'
41--- modules/Ubuntu/Components/TextField.qml 2013-02-13 17:05:27 +0000
42+++ modules/Ubuntu/Components/TextField.qml 2013-02-15 09:29:57 +0000
43@@ -394,7 +394,7 @@
44 */
45 function forceActiveFocus()
46 {
47- editor.forceActiveFocus();
48+ internal.activateEditor();
49 }
50
51 // internals
52@@ -411,7 +411,7 @@
53 anchors.fill: parent
54 // us it only when there is space between the frame and input
55 enabled: internal.spacing > 0
56- onClicked: editor.forceActiveFocus()
57+ onClicked: internal.activateEditor()
58 }
59
60 Text { id: fontHolder }
61@@ -435,7 +435,9 @@
62 function activateEditor()
63 {
64 if (!control.activeFocus)
65- control.forceActiveFocus();
66+ editor.forceActiveFocus();
67+ else
68+ showInputPanel();
69 }
70
71 function showInputPanel()
72@@ -443,7 +445,8 @@
73 if (control.customSoftwareInputPanel != undefined) {
74 // TODO implement once we have the SIP ready
75 } else {
76- Qt.inputMethod.show();
77+ if (!Qt.inputMethod.visible)
78+ Qt.inputMethod.show();
79 }
80 textChanged = false;
81 }
82@@ -649,6 +652,7 @@
83 // don't do anything while the control is inactive
84 if (!control.activeFocus || (pressedButtons != Qt.LeftButton))
85 return;
86+ internal.activateEditor();
87 if (internal.selectionEnd == internal.selectionStart) {
88 internal.resetEditorSelection(mouse.x);
89 internal.selectionMode = true;

Subscribers

People subscribed via source and target branches

to status/vote changes: