Merge lp:~renatofilho/ubuntu-ui-toolkit/fix-keyboard-visibility into lp:ubuntu-ui-toolkit

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Florian Boucault
Approved revision: 633
Merged at revision: 633
Proposed branch: lp:~renatofilho/ubuntu-ui-toolkit/fix-keyboard-visibility
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 69 lines (+23/-0)
3 files modified
CHANGES (+1/-0)
components.api (+1/-0)
modules/Ubuntu/Components/MainView.qml (+21/-0)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-ui-toolkit/fix-keyboard-visibility
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Florian Boucault (community) Needs Fixing
Review via email: mp+174503@code.launchpad.net

Commit message

Make sure that the keyboard does not obscure the contents of main window.

To post a comment you must log in.
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)
Revision history for this message
Florian Boucault (fboucault) wrote :

Add a FIXME next to "Behavior on bottomMargin" saying that it's not well synchronised with the keyboard's animation and why.

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

// make the hole contents visible is the toolbar is locked otherwise the toolbar will obscure part of the contents

should be:

// move the whole contents up if the toolbar is locked and opened otherwise the toolbar will obscure part of the contents

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

 The property holds if the application should automaticaly resize the [...]

should be

 The property holds if the application should automatically resize the [...]

Revision history for this message
Florian Boucault (fboucault) wrote :

Thanks for adding the line to CHANGES. We also have an automatic API checker that outputs components.api and components.api.new when running make check. They need to be in sync otherwise the tests fail.

review: Needs Fixing
Revision history for this message
Florian Boucault (fboucault) wrote :

Documentation of anchorToKeyboard needs to specify what the default value is.

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

> Thanks for adding the line to CHANGES. We also have an automatic API checker
> that outputs components.api and components.api.new when running make check.
> They need to be in sync otherwise the tests fail.

See test failure output:

--- components.api 2013-07-12 22:47:31.000000000 +0000
+++ components.api.new 2013-07-12 22:50:59.189958961 +0000
@@ -81,6 +81,7 @@ modules/Ubuntu/Components/Label.qml
 modules/Ubuntu/Components/MainView.qml
 PageTreeNode
     property string applicationName
+ property bool anchorToKeyboard
     property color headerColor
     property color backgroundColor
     property color footerColor

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES'
2--- CHANGES 2013-07-01 19:05:06 +0000
3+++ CHANGES 2013-07-13 00:02:26 +0000
4@@ -39,6 +39,7 @@
5 * DEPRECATED IN Action: property bool visible
6 * DEPRECATED IN Action: property Item itemHint
7 * DEPRECATED: ToolbarActions component (use ToolbarItems instead)
8+* ADDED IN MainView: property bool anchorToKeyboard
9
10 Compatibility Breaks
11 ********************
12
13=== modified file 'components.api'
14--- components.api 2013-07-12 05:22:28 +0000
15+++ components.api 2013-07-13 00:02:26 +0000
16@@ -81,6 +81,7 @@
17 modules/Ubuntu/Components/MainView.qml
18 PageTreeNode
19 property string applicationName
20+ property bool anchorToKeyboard
21 property color headerColor
22 property color backgroundColor
23 property color footerColor
24
25=== modified file 'modules/Ubuntu/Components/MainView.qml'
26--- modules/Ubuntu/Components/MainView.qml 2013-07-12 05:32:25 +0000
27+++ modules/Ubuntu/Components/MainView.qml 2013-07-13 00:02:26 +0000
28@@ -136,6 +136,15 @@
29 property string applicationName: ""
30
31 /*!
32+ \preliminary
33+ The property holds if the application should automatically resize the
34+ contents when the input method appears
35+
36+ The default value is false.
37+ */
38+ property bool anchorToKeyboard: false
39+
40+ /*!
41 \qmlproperty color headerColor
42 Color of the header's background.
43
44@@ -214,6 +223,15 @@
45 id: canvas
46
47 automaticOrientation: false
48+ // this will make sure that the keyboard does not obscure the contents
49+ anchors {
50+ bottomMargin: Qt.inputMethod.visible && anchorToKeyboard ? Qt.inputMethod.keyboardRectangle.height : 0
51+ //this is an attempt to keep the keyboard animation in sync with the content resize
52+ //but this does not work very well because the keyboard animation has different steps
53+ Behavior on bottomMargin {
54+ NumberAnimation { easing.type: Easing.InOutQuad }
55+ }
56+ }
57
58 // clip the contents so that it does not overlap the header
59 Item {
60@@ -234,6 +252,9 @@
61 id: contents
62 anchors {
63 fill: parent
64+
65+ // move the whole contents up if the toolbar is locked and opened otherwise the toolbar will obscure part of the contents
66+ bottomMargin: toolbarItem.locked && toolbarItem.opened ? toolbarItem.height + toolbarItem.triggerSize : 0
67 // compensate so that the actual y is always 0
68 topMargin: -parent.y
69 }

Subscribers

People subscribed via source and target branches

to status/vote changes: