Merge lp:~fboucault/ubuntu-ui-toolkit/fix_overlap_osk into lp:ubuntu-ui-toolkit

Proposed by Florian Boucault
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 1052
Merged at revision: 1051
Proposed branch: lp:~fboucault/ubuntu-ui-toolkit/fix_overlap_osk
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 68 lines (+14/-3)
4 files modified
components.api (+1/-0)
modules/Ubuntu/Components/MainView.qml (+1/-2)
modules/Ubuntu/Components/OrientationHelper.qml (+11/-1)
modules/Ubuntu/Components/Popups/PopupBase.qml (+1/-0)
To merge this branch: bzr merge lp:~fboucault/ubuntu-ui-toolkit/fix_overlap_osk
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Tim Peeters Approve
Review via email: mp+226286@code.launchpad.net

Commit message

Move keyboard anchoring logic of OrientationHelper from MainView to OrientationHelper itself.

To post a comment you must log in.
1052. By Florian Boucault

Tag bugs

Revision history for this message
Tim Peeters (tpeeters) wrote :

Code looks good.
I manually tested sudoku-app and gallery-app and executed the tests that were failing, and all is good now.

Thanks!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2014-07-03 13:59:52 +0000
3+++ components.api 2014-07-10 12:08:33 +0000
4@@ -235,6 +235,7 @@
5 property alias rotating
6 property int __orientationAngle
7 property int orientationAngle
8+ property bool anchorToKeyboard
9 Page 0.1 1.0
10 PageTreeNode
11 property string title
12
13=== modified file 'modules/Ubuntu/Components/MainView.qml'
14--- modules/Ubuntu/Components/MainView.qml 2014-06-30 17:49:31 +0000
15+++ modules/Ubuntu/Components/MainView.qml 2014-07-10 12:08:33 +0000
16@@ -244,9 +244,8 @@
17 id: canvas
18
19 automaticOrientation: false
20- // this will make sure that the keyboard does not obscure the contents
21+ anchorToKeyboard: mainView.anchorToKeyboard
22 anchors {
23- bottomMargin: Qt.inputMethod.visible && anchorToKeyboard ? Qt.inputMethod.keyboardRectangle.height : 0
24 //this is an attempt to keep the keyboard animation in sync with the content resize
25 //but this does not work very well because the keyboard animation has different steps
26 Behavior on bottomMargin {
27
28=== modified file 'modules/Ubuntu/Components/OrientationHelper.qml'
29--- modules/Ubuntu/Components/OrientationHelper.qml 2014-06-18 08:23:20 +0000
30+++ modules/Ubuntu/Components/OrientationHelper.qml 2014-07-10 12:08:33 +0000
31@@ -88,6 +88,15 @@
32 */
33 property int orientationAngle: automaticOrientation ? Screen.angleBetween(Screen.primaryOrientation, Screen.orientation) : 0
34
35+ /*!
36+ \preliminary
37+ The property holds if the OrientationHelper should automatically resize the
38+ contents when the input method appears
39+
40+ The default value is false.
41+ */
42+ property bool anchorToKeyboard: false
43+
44 anchors.fill: parent
45
46 Component.onCompleted: orientationTransition.enabled = transitionEnabled
47@@ -143,7 +152,8 @@
48 orientationHelper.anchors.leftMargin = 0;
49 orientationHelper.anchors.rightMargin = 0;
50 orientationHelper.anchors.topMargin = 0;
51- orientationHelper.anchors.bottomMargin = 0;
52+ // this will make sure that the keyboard does not obscure the contents
53+ orientationHelper.anchors.bottomMargin = Qt.binding(function() {return Qt.inputMethod.visible && anchorToKeyboard ? Qt.inputMethod.keyboardRectangle.height : 0});
54 orientationHelper.anchors.fill = orientationHelper.parent;
55 }
56 }
57
58=== modified file 'modules/Ubuntu/Components/Popups/PopupBase.qml'
59--- modules/Ubuntu/Components/Popups/PopupBase.qml 2014-05-12 18:02:34 +0000
60+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2014-07-10 12:08:33 +0000
61@@ -55,6 +55,7 @@
62 // copy value of automaticOrientation from root object (typically a MainView)
63 automaticOrientation: stateWrapper.rootItem && stateWrapper.rootItem.automaticOrientation ?
64 stateWrapper.rootItem.automaticOrientation : false
65+ anchorToKeyboard: true
66
67 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
68 LayoutMirroring.childrenInherit: true

Subscribers

People subscribed via source and target branches

to status/vote changes: