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
=== modified file 'components.api'
--- components.api 2014-07-03 13:59:52 +0000
+++ components.api 2014-07-10 12:08:33 +0000
@@ -235,6 +235,7 @@
235 property alias rotating235 property alias rotating
236 property int __orientationAngle236 property int __orientationAngle
237 property int orientationAngle237 property int orientationAngle
238 property bool anchorToKeyboard
238Page 0.1 1.0239Page 0.1 1.0
239PageTreeNode240PageTreeNode
240 property string title241 property string title
241242
=== modified file 'modules/Ubuntu/Components/MainView.qml'
--- modules/Ubuntu/Components/MainView.qml 2014-06-30 17:49:31 +0000
+++ modules/Ubuntu/Components/MainView.qml 2014-07-10 12:08:33 +0000
@@ -244,9 +244,8 @@
244 id: canvas244 id: canvas
245245
246 automaticOrientation: false246 automaticOrientation: false
247 // this will make sure that the keyboard does not obscure the contents247 anchorToKeyboard: mainView.anchorToKeyboard
248 anchors {248 anchors {
249 bottomMargin: Qt.inputMethod.visible && anchorToKeyboard ? Qt.inputMethod.keyboardRectangle.height : 0
250 //this is an attempt to keep the keyboard animation in sync with the content resize249 //this is an attempt to keep the keyboard animation in sync with the content resize
251 //but this does not work very well because the keyboard animation has different steps250 //but this does not work very well because the keyboard animation has different steps
252 Behavior on bottomMargin {251 Behavior on bottomMargin {
253252
=== modified file 'modules/Ubuntu/Components/OrientationHelper.qml'
--- modules/Ubuntu/Components/OrientationHelper.qml 2014-06-18 08:23:20 +0000
+++ modules/Ubuntu/Components/OrientationHelper.qml 2014-07-10 12:08:33 +0000
@@ -88,6 +88,15 @@
88 */88 */
89 property int orientationAngle: automaticOrientation ? Screen.angleBetween(Screen.primaryOrientation, Screen.orientation) : 089 property int orientationAngle: automaticOrientation ? Screen.angleBetween(Screen.primaryOrientation, Screen.orientation) : 0
9090
91 /*!
92 \preliminary
93 The property holds if the OrientationHelper should automatically resize the
94 contents when the input method appears
95
96 The default value is false.
97 */
98 property bool anchorToKeyboard: false
99
91 anchors.fill: parent100 anchors.fill: parent
92101
93 Component.onCompleted: orientationTransition.enabled = transitionEnabled102 Component.onCompleted: orientationTransition.enabled = transitionEnabled
@@ -143,7 +152,8 @@
143 orientationHelper.anchors.leftMargin = 0;152 orientationHelper.anchors.leftMargin = 0;
144 orientationHelper.anchors.rightMargin = 0;153 orientationHelper.anchors.rightMargin = 0;
145 orientationHelper.anchors.topMargin = 0;154 orientationHelper.anchors.topMargin = 0;
146 orientationHelper.anchors.bottomMargin = 0;155 // this will make sure that the keyboard does not obscure the contents
156 orientationHelper.anchors.bottomMargin = Qt.binding(function() {return Qt.inputMethod.visible && anchorToKeyboard ? Qt.inputMethod.keyboardRectangle.height : 0});
147 orientationHelper.anchors.fill = orientationHelper.parent;157 orientationHelper.anchors.fill = orientationHelper.parent;
148 }158 }
149 }159 }
150160
=== modified file 'modules/Ubuntu/Components/Popups/PopupBase.qml'
--- modules/Ubuntu/Components/Popups/PopupBase.qml 2014-05-12 18:02:34 +0000
+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2014-07-10 12:08:33 +0000
@@ -55,6 +55,7 @@
55 // copy value of automaticOrientation from root object (typically a MainView)55 // copy value of automaticOrientation from root object (typically a MainView)
56 automaticOrientation: stateWrapper.rootItem && stateWrapper.rootItem.automaticOrientation ?56 automaticOrientation: stateWrapper.rootItem && stateWrapper.rootItem.automaticOrientation ?
57 stateWrapper.rootItem.automaticOrientation : false57 stateWrapper.rootItem.automaticOrientation : false
58 anchorToKeyboard: true
5859
59 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft60 LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
60 LayoutMirroring.childrenInherit: true61 LayoutMirroring.childrenInherit: true

Subscribers

People subscribed via source and target branches

to status/vote changes: