Merge lp:~tiagosh/address-book-app/fix-1199122 into lp:address-book-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Bill Filler
Approved revision: 64
Merged at revision: 77
Proposed branch: lp:~tiagosh/address-book-app/fix-1199122
Merge into: lp:address-book-app
Diff against target: 141 lines (+93/-2)
5 files modified
src/imports/ContactEdit/CMakeLists.txt (+2/-0)
src/imports/ContactEdit/ContactEditor.qml (+5/-1)
src/imports/ContactEdit/KeyboardRectangle.qml (+63/-0)
src/imports/ContactEdit/StandardAnimation.qml (+22/-0)
src/imports/main.qml (+1/-1)
To merge this branch: bzr merge lp:~tiagosh/address-book-app/fix-1199122
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+184904@code.launchpad.net

Commit message

Do not bind mainview to keyboard, so we dont show the toolbar when dismissing the osk.

Description of the change

do not bind mainview to keyboard so we dont show the toolbar when dismissing the osk.

This MR adds a custom component called KeyboardRectangle, same component we use in messaging-app and the old phone-app.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

doesn't work for me. If I press edit or add I just get a blank view now

review: Needs Fixing
64. By Tiago Salem Herrmann

fix cmakelists.txt

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

this works, however I did notice a related bug. If you dismiss the keyboard and then click in an entry field near the bottom of the page, when the keyboard is shown the field is not scrolled into view and it should be. Is it possible to update this MR to fix that issue or should we approve this and do that fix in a separate MR?

Revision history for this message
Bill Filler (bfiller) wrote :

approving this for now, will file a separate bug for scroll into view issue

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/ContactEdit/CMakeLists.txt'
2--- src/imports/ContactEdit/CMakeLists.txt 2013-08-02 17:40:44 +0000
3+++ src/imports/ContactEdit/CMakeLists.txt 2013-09-11 17:49:15 +0000
4@@ -9,6 +9,8 @@
5 ContactDetailWithTypeEditor.qml
6 ContactEditor.qml
7 EditToolbar.qml
8+ KeyboardRectangle.qml
9+ StandardAnimation.qml
10 TextInputDetail.qml
11 ValueSelector.qml
12 )
13
14=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
15--- src/imports/ContactEdit/ContactEditor.qml 2013-08-28 17:06:38 +0000
16+++ src/imports/ContactEdit/ContactEditor.qml 2013-09-11 17:49:15 +0000
17@@ -213,7 +213,7 @@
18 anchors {
19 left: parent.left
20 right: parent.right
21- bottom: parent.bottom
22+ bottom: keyboard.top
23 }
24 height: units.gu(6)
25 acceptAction: Action {
26@@ -229,4 +229,8 @@
27 onTriggered: pageStack.pop()
28 }
29 }
30+
31+ KeyboardRectangle {
32+ id: keyboard
33+ }
34 }
35
36=== added file 'src/imports/ContactEdit/KeyboardRectangle.qml'
37--- src/imports/ContactEdit/KeyboardRectangle.qml 1970-01-01 00:00:00 +0000
38+++ src/imports/ContactEdit/KeyboardRectangle.qml 2013-09-11 17:49:15 +0000
39@@ -0,0 +1,63 @@
40+/*
41+ * Copyright (C) 2012-2013 Canonical, Ltd.
42+ *
43+ * This program is free software; you can redistribute it and/or modify
44+ * it under the terms of the GNU General Public License as published by
45+ * the Free Software Foundation; version 3.
46+ *
47+ * This program is distributed in the hope that it will be useful,
48+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
49+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+ * GNU General Public License for more details.
51+ *
52+ * You should have received a copy of the GNU General Public License
53+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
54+ */
55+
56+import QtQuick 2.0
57+
58+Item {
59+ id: keyboardRect
60+ anchors.left: parent.left
61+ anchors.right: parent.right
62+ anchors.bottom: parent.bottom
63+ height: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
64+
65+ Behavior on height {
66+ StandardAnimation { }
67+ }
68+
69+ function recursiveFindFocusedItem(parent) {
70+ if (parent.activeFocus) {
71+ return parent;
72+ }
73+
74+ for (var i in parent.children) {
75+ var child = parent.children[i];
76+ if (child.activeFocus) {
77+ return child;
78+ }
79+
80+ var item = recursiveFindFocusedItem(child);
81+
82+ if (item != null) {
83+ return item;
84+ }
85+ }
86+
87+ return null;
88+ }
89+
90+ Connections {
91+ target: Qt.inputMethod
92+
93+ onVisibleChanged: {
94+ if (!Qt.inputMethod.visible) {
95+ var focusedItem = recursiveFindFocusedItem(keyboardRect.parent);
96+ if (focusedItem != null) {
97+ focusedItem.focus = false;
98+ }
99+ }
100+ }
101+ }
102+}
103
104=== added file 'src/imports/ContactEdit/StandardAnimation.qml'
105--- src/imports/ContactEdit/StandardAnimation.qml 1970-01-01 00:00:00 +0000
106+++ src/imports/ContactEdit/StandardAnimation.qml 2013-09-11 17:49:15 +0000
107@@ -0,0 +1,22 @@
108+/*
109+ * Copyright (C) 2012-2013 Canonical, Ltd.
110+ *
111+ * This program is free software; you can redistribute it and/or modify
112+ * it under the terms of the GNU General Public License as published by
113+ * the Free Software Foundation; version 3.
114+ *
115+ * This program is distributed in the hope that it will be useful,
116+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
117+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
118+ * GNU General Public License for more details.
119+ *
120+ * You should have received a copy of the GNU General Public License
121+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
122+ */
123+
124+import QtQuick 2.0
125+
126+NumberAnimation {
127+ duration: 300
128+ easing.type: Easing.InOutQuad
129+}
130
131=== modified file 'src/imports/main.qml'
132--- src/imports/main.qml 2013-09-09 21:38:01 +0000
133+++ src/imports/main.qml 2013-09-11 17:49:15 +0000
134@@ -23,7 +23,7 @@
135
136 width: units.gu(40)
137 height: units.gu(71)
138- anchorToKeyboard: true
139+ anchorToKeyboard: false
140
141 signal applicationReady()
142

Subscribers

People subscribed via source and target branches