Skip to content

Commit e7cecbe

Browse files
committed
Make sure input fields are not covered by VKB on Symbian.
1 parent 333e1d2 commit e7cecbe

File tree

8 files changed

+257
-200
lines changed

8 files changed

+257
-200
lines changed

meego.qrc

+1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<file alias="StepsToolIcon.qml">qml/meego/StepsToolIcon.qml</file>
1818
<file alias="StepsScrollDecorator.qml">qml/meego/StepsScrollDecorator.qml</file>
1919
<file alias="StepsToolButton.qml">qml/meego/StepsToolButton.qml</file>
20+
<file alias="StepsFlickable.qml">qml/meego/StepsFlickable.qml</file>
2021
</qresource>
2122
</RCC>

qml/SettingsPage.qml

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import QtQuick 1.1
2-
import "meego"
2+
import "symbian"
33

44
StepsPage {
55
id: settings
66

7-
Flickable {
7+
StepsFlickable {
88
id: flickable
99
anchors.fill: parent
1010
anchors.margins: 15
@@ -142,15 +142,15 @@ StepsPage {
142142
if (platform.osName !== "symbian") {
143143
showExit.height = 0
144144
showExit.visible = false
145-
} else {
146-
custom1Label.height = 0
147-
custom1Label.visible = 0
148-
custom1Text.height = 0
149-
custom1Text.visible = 0
150-
custom2Label.height = 0
151-
custom2Label.visible = 0
152-
custom2Text.height = 0
153-
custom2Text.visible = 0
145+
// } else {
146+
// custom1Label.height = 0
147+
// custom1Label.visible = 0
148+
// custom1Text.height = 0
149+
// custom1Text.visible = 0
150+
// custom2Label.height = 0
151+
// custom2Label.visible = 0
152+
// custom2Text.height = 0
153+
// custom2Text.visible = 0
154154
}
155155
}
156156
}

qml/meego/StepsFlickable.qml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import QtQuick 1.1
2+
import com.nokia.meego 1.0
3+
4+
// Just a Flickable
5+
Flickable {
6+
}

qml/symbian/StepsFlickable.qml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import QtQuick 1.1
2+
import com.nokia.symbian 1.1
3+
4+
// A Flickable that can elevate children if they are obscured by the virtual keyboard
5+
Flickable {
6+
id: flickable
7+
8+
Timer {
9+
id: adjuster
10+
interval: 200
11+
onTriggered: flickable.adjust()
12+
}
13+
14+
Component.onCompleted: inputContext.visibleChanged.connect(adjuster.restart)
15+
16+
function adjust() {
17+
if (!inputContext.visible) {
18+
return
19+
}
20+
21+
var focusChild = null
22+
function findFocusChild(p) {
23+
if (p["activeFocus"] === true) {
24+
focusChild = p
25+
} else {
26+
for (var i = 0; i < p["children"].length; i++) {
27+
findFocusChild(p["children"][i])
28+
if (focusChild !== null) {
29+
break
30+
}
31+
}
32+
}
33+
}
34+
findFocusChild(flickable)
35+
36+
if (focusChild === null) {
37+
return
38+
}
39+
var focusChildY = focusChild["y"]
40+
var focusChildHeight = focusChild["height"]
41+
if ((flickable.contentY + flickable.height) < (focusChildY + focusChildHeight)) {
42+
flickable.contentY = focusChildY + focusChildHeight - flickable.height
43+
}
44+
}
45+
}

qml/symbian/StepsPageStackWindow.qml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import com.nokia.symbian 1.1
33

44
PageStackWindow {
55
property bool toolBar: false // Ignored on Symbian
6-
// platformSoftwareInputPanelEnabled: true
6+
platformSoftwareInputPanelEnabled: true
77
// showToolBar: !inputContext.visible;
88
// showStatusBar: !inputContext.visible;
99
}

qtc_packaging/debian_harmattan/changelog

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
steps (0.1.2) unstable; urgency=low
22

3+
* Make sure input fields are not covered by VKB on Symbian
4+
35
-- Akos Polster <akos@pipacs.com> Sun, 5 Feb 2012 03:38:00 +0100
46

57
steps (0.1.1) unstable; urgency=low

0 commit comments

Comments
 (0)