Merge lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-fix-mir-rotation into lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-qml-port

Proposed by Thomas Moenicke
Status: Needs review
Proposed branch: lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-fix-mir-rotation
Merge into: lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-qml-port
Diff against target: 243 lines (+40/-81)
6 files modified
buildOnDevice.sh (+1/-1)
qml/Keyboard.qml (+33/-14)
qml/RotationHelper.qml (+0/-59)
qml/qml.pro (+0/-1)
src/plugin/inputmethod.cpp (+2/-1)
src/plugin/inputmethod_p.h (+4/-5)
To merge this branch: bzr merge lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-fix-mir-rotation
Reviewer Review Type Date Requested Status
Bill Filler (community) Disapprove
Thomas Moenicke Pending
Review via email: mp+184366@code.launchpad.net

Commit message

ubuntu-keyboard fullscreen

Description of the change

ubuntu-keyboard fullscreen

To post a comment you must log in.
48. By Thomas Moenicke

fixed wordribbon on/off for fullscreen osk

49. By Thomas Moenicke

merged with master branch

Revision history for this message
Bill Filler (bfiller) :
review: Disapprove

Unmerged revisions

49. By Thomas Moenicke

merged with master branch

48. By Thomas Moenicke

fixed wordribbon on/off for fullscreen osk

47. By Thomas Moenicke

changing ubuntu-keyboard to fullscreen. Input trap is still calculated.
Using OrientationHelper.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildOnDevice.sh'
2--- buildOnDevice.sh 2013-09-04 13:45:11 +0000
3+++ buildOnDevice.sh 2013-09-09 08:52:28 +0000
4@@ -88,7 +88,7 @@
5 adb shell pkill "webbrowser-app"
6 adb shell pkill "qmlscene"
7
8- exec_with_ssh "$BINARY $RUN_OPTIONS"
9+# exec_with_ssh "$BINARY $RUN_OPTIONS"
10 }
11
12 set -- `getopt -n$0 -u -a --longoptions="setup,help" "sh" "$@"`
13
14=== modified file 'qml/Keyboard.qml'
15--- qml/Keyboard.qml 2013-09-07 08:23:38 +0000
16+++ qml/Keyboard.qml 2013-09-09 08:52:28 +0000
17@@ -33,12 +33,32 @@
18 import "constants.js" as Const
19
20 import "keys/key_constants.js" as UI
21+import Ubuntu.Components 0.1
22+import QtQuick.Window 2.0
23+
24+Item {
25+ objectName: "fullScreenItem"
26+
27+ property variant layout: maliit_layout
28+ property variant event_handler: maliit_event_handler
29+
30+OrientationHelper {
31+
32+ automaticOrientation: false
33+ transitionEnabled: false
34+
35+ orientationAngle: Screen.angleBetween(Screen.primaryOrientation, canvas.contentOrientation);
36
37 Item {
38 id: canvas
39 objectName: "ubuntuKeyboard" // Allow us to specify a specific keyboard within autopilot.
40- property variant layout: maliit_layout
41- property variant event_handler: maliit_event_handler
42+
43+ anchors.bottom: parent.bottom
44+ anchors.left: parent.left
45+
46+ width: parent.width
47+
48+ property int keypadHeight: 0 // set by InputMethod
49
50 property string layoutId: "en_us"
51 onLayoutIdChanged: keypad.loadLayout(layoutId);
52@@ -49,16 +69,14 @@
53 //readonly property var layoutState: layout.keyboard_state
54 //readonly property string activeView: layout.activeView
55
56- property int contentOrientation: Qt.PrimaryOrientation
57+ property int contentOrientation: Qt.PrimaryOrientation // overwritten by inputMethod
58
59 property bool shown: false;
60- property bool wordribbon_visible: true;
61-
62+ property bool wordribbon_visible: false;
63 property bool hideAnimationFinished: false;
64 property int pressedKeyIndex: -1;
65 property Item pressedKey;
66
67- RotationHelper {
68
69 MouseArea {
70 id: keyboardSurface
71@@ -80,20 +98,20 @@
72 id: wordRibbon
73 objectName: "wordRibbon"
74
75+ visible: canvas.wordribbon_visible
76+
77 anchors.bottom: keyboardComp.top
78 width: parent.width;
79
80- height: wordribbon_visible ? layout.wordribbon_height : 0
81+ height: visible ? layout.wordribbon_height : 0
82 }
83
84 Item {
85 id: keyboardComp
86
87- anchors {
88- top: wordRibbon.bottom
89- fill: parent
90- topMargin: layout.invisible_toucharea_height + (wordribbon_visible ? layout.wordribbon_height : 0);
91- }
92+ height: canvas.keypadHeight - wordRibbon.height
93+ width: parent.width
94+ anchors.bottom: parent.bottom
95
96 Rectangle {
97 id: background
98@@ -158,7 +176,6 @@
99 }
100
101 } // big mousearea
102- } // rotation helper
103
104 state: "HIDDEN"
105
106@@ -183,5 +200,7 @@
107 transitions: Transition {
108 PropertyAnimation { target: canvas; properties: "y"; easing.type: Easing.InOutQuad }
109 }
110-}
111
112+} // canvas
113+} // OrientationHelper
114+} // fullScreenItem
115
116=== removed file 'qml/RotationHelper.qml'
117--- qml/RotationHelper.qml 2013-08-09 15:22:29 +0000
118+++ qml/RotationHelper.qml 1970-01-01 00:00:00 +0000
119@@ -1,59 +0,0 @@
120-/*
121- * Copyright 2013 Canonical Ltd.
122- *
123- * This program is free software; you can redistribute it and/or modify
124- * it under the terms of the GNU Lesser General Public License as published by
125- * the Free Software Foundation; version 3.
126- *
127- * This program is distributed in the hope that it will be useful,
128- * but WITHOUT ANY WARRANTY; without even the implied warranty of
129- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
130- * GNU Lesser General Public License for more details.
131- *
132- * You should have received a copy of the GNU Lesser General Public License
133- * along with this program. If not, see <http://www.gnu.org/licenses/>.
134- */
135-
136-import QtQuick 2.0
137-import QtQuick.Window 2.0
138-
139-Item {
140- id: rotationHelper
141-
142- property string __rotationString: Screen.angleBetween(Screen.primaryOrientation, contentOrientation).toString();
143-
144- rotation: Screen.angleBetween(Screen.primaryOrientation, contentOrientation);
145-
146- anchors.fill: parent
147-
148- Item {
149- state: __rotationString
150-
151- states: [
152- State {
153- name: "270"
154- PropertyChanges {
155- target: rotationHelper
156- anchors {
157- leftMargin: (parent.width - parent.height) / 2
158- rightMargin: anchors.leftMargin
159- topMargin: -anchors.leftMargin
160- bottomMargin: anchors.topMargin
161- }
162- }
163- },
164- State {
165- name: "90"
166- PropertyChanges {
167- target: rotationHelper
168- anchors {
169- leftMargin: (parent.width - parent.height) / 2
170- rightMargin: anchors.leftMargin
171- topMargin: -anchors.leftMargin
172- bottomMargin: anchors.topMargin
173- }
174- }
175- }
176- ]
177- }
178-}
179
180=== modified file 'qml/qml.pro'
181--- qml/qml.pro 2013-09-07 07:55:28 +0000
182+++ qml/qml.pro 2013-09-09 08:52:28 +0000
183@@ -24,7 +24,6 @@
184 maliit-magnifier.qml \
185 Keyboard.qml \
186 maliit-ui-constants.qml \
187- RotationHelper.qml \
188 WordRibbon.qml \
189 Popper.qml \
190 KeyboardContainer.qml \
191
192=== modified file 'src/plugin/inputmethod.cpp'
193--- src/plugin/inputmethod.cpp 2013-09-03 11:14:53 +0000
194+++ src/plugin/inputmethod.cpp 2013-09-09 08:52:28 +0000
195@@ -85,6 +85,7 @@
196 Q_D(InputMethod);
197
198 d->view->setSource(QUrl::fromLocalFile(g_maliit_keyboard_qml));
199+ d->view->setGeometry(qGuiApp->primaryScreen()->geometry());
200
201 // FIXME: Reconnect feedback instance.
202 Setup::connectAll(&d->layout.event_handler, &d->layout.updater, &d->editor);
203@@ -451,7 +452,7 @@
204 switch (status) {
205 case QQuickView::Ready:
206 {
207- d->qmlRootItem = qobject_cast<QQuickItem*> (d->view->rootObject());
208+ d->qmlRootItem = d->view->rootObject()->findChild<QQuickItem*>("ubuntuKeyboard");
209 QObject::connect(d->qmlRootItem, SIGNAL(hideAnimationFinishedChanged()), this, SLOT(onHideAnimationFinished()));
210 }
211 break;
212
213=== modified file 'src/plugin/inputmethod_p.h'
214--- src/plugin/inputmethod_p.h 2013-09-03 11:14:53 +0000
215+++ src/plugin/inputmethod_p.h 2013-09-09 08:52:28 +0000
216@@ -195,15 +195,16 @@
217
218 keyboardVisibleRect = windowGeometryRect.adjusted(0,uiConst->invisibleTouchAreaHeight(orientation),0,0);
219
220+ qmlRootItem->setProperty("height", windowGeometryRect.height());
221+ qmlRootItem->setProperty("keypadHeight", keyboardVisibleRect.height());
222+ qmlRootItem->setProperty("contentOrientation", screenOrientation);
223+
224 // qpa does not rotate the coordinate system
225 windowGeometryRect = qGuiApp->primaryScreen()->mapBetween(
226 screenOrientation,
227 qGuiApp->primaryScreen()->primaryOrientation(),
228 windowGeometryRect);
229
230-
231- view->setGeometry(windowGeometryRect);
232-
233 if (qmlRootItem->property("shown").toBool()) {
234 host->setScreenRegion(QRegion(keyboardVisibleRect));
235
236@@ -212,8 +213,6 @@
237 host->setInputMethodArea(rect, view);
238 }
239
240- qmlRootItem->setProperty("contentOrientation", screenOrientation);
241-
242 if (qmlRootItem->property("shown").toBool()) {
243 applicationApiWrapper->reportOSKInvisible();
244

Subscribers

People subscribed via source and target branches

to all changes: