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
=== modified file 'buildOnDevice.sh'
--- buildOnDevice.sh 2013-09-04 13:45:11 +0000
+++ buildOnDevice.sh 2013-09-09 08:52:28 +0000
@@ -88,7 +88,7 @@
88 adb shell pkill "webbrowser-app"88 adb shell pkill "webbrowser-app"
89 adb shell pkill "qmlscene"89 adb shell pkill "qmlscene"
9090
91 exec_with_ssh "$BINARY $RUN_OPTIONS"91# exec_with_ssh "$BINARY $RUN_OPTIONS"
92}92}
9393
94set -- `getopt -n$0 -u -a --longoptions="setup,help" "sh" "$@"`94set -- `getopt -n$0 -u -a --longoptions="setup,help" "sh" "$@"`
9595
=== modified file 'qml/Keyboard.qml'
--- qml/Keyboard.qml 2013-09-07 08:23:38 +0000
+++ qml/Keyboard.qml 2013-09-09 08:52:28 +0000
@@ -33,12 +33,32 @@
33import "constants.js" as Const33import "constants.js" as Const
3434
35import "keys/key_constants.js" as UI35import "keys/key_constants.js" as UI
36import Ubuntu.Components 0.1
37import QtQuick.Window 2.0
38
39Item {
40 objectName: "fullScreenItem"
41
42 property variant layout: maliit_layout
43 property variant event_handler: maliit_event_handler
44
45OrientationHelper {
46
47 automaticOrientation: false
48 transitionEnabled: false
49
50 orientationAngle: Screen.angleBetween(Screen.primaryOrientation, canvas.contentOrientation);
3651
37Item {52Item {
38 id: canvas53 id: canvas
39 objectName: "ubuntuKeyboard" // Allow us to specify a specific keyboard within autopilot.54 objectName: "ubuntuKeyboard" // Allow us to specify a specific keyboard within autopilot.
40 property variant layout: maliit_layout55
41 property variant event_handler: maliit_event_handler56 anchors.bottom: parent.bottom
57 anchors.left: parent.left
58
59 width: parent.width
60
61 property int keypadHeight: 0 // set by InputMethod
4262
43 property string layoutId: "en_us"63 property string layoutId: "en_us"
44 onLayoutIdChanged: keypad.loadLayout(layoutId);64 onLayoutIdChanged: keypad.loadLayout(layoutId);
@@ -49,16 +69,14 @@
49 //readonly property var layoutState: layout.keyboard_state69 //readonly property var layoutState: layout.keyboard_state
50 //readonly property string activeView: layout.activeView70 //readonly property string activeView: layout.activeView
5171
52 property int contentOrientation: Qt.PrimaryOrientation72 property int contentOrientation: Qt.PrimaryOrientation // overwritten by inputMethod
5373
54 property bool shown: false;74 property bool shown: false;
55 property bool wordribbon_visible: true;75 property bool wordribbon_visible: false;
56
57 property bool hideAnimationFinished: false;76 property bool hideAnimationFinished: false;
58 property int pressedKeyIndex: -1;77 property int pressedKeyIndex: -1;
59 property Item pressedKey;78 property Item pressedKey;
6079
61 RotationHelper {
6280
63 MouseArea {81 MouseArea {
64 id: keyboardSurface82 id: keyboardSurface
@@ -80,20 +98,20 @@
80 id: wordRibbon98 id: wordRibbon
81 objectName: "wordRibbon"99 objectName: "wordRibbon"
82100
101 visible: canvas.wordribbon_visible
102
83 anchors.bottom: keyboardComp.top103 anchors.bottom: keyboardComp.top
84 width: parent.width;104 width: parent.width;
85105
86 height: wordribbon_visible ? layout.wordribbon_height : 0106 height: visible ? layout.wordribbon_height : 0
87 }107 }
88108
89 Item {109 Item {
90 id: keyboardComp110 id: keyboardComp
91111
92 anchors {112 height: canvas.keypadHeight - wordRibbon.height
93 top: wordRibbon.bottom113 width: parent.width
94 fill: parent114 anchors.bottom: parent.bottom
95 topMargin: layout.invisible_toucharea_height + (wordribbon_visible ? layout.wordribbon_height : 0);
96 }
97115
98 Rectangle {116 Rectangle {
99 id: background117 id: background
@@ -158,7 +176,6 @@
158 }176 }
159177
160 } // big mousearea178 } // big mousearea
161 } // rotation helper
162179
163 state: "HIDDEN"180 state: "HIDDEN"
164181
@@ -183,5 +200,7 @@
183 transitions: Transition {200 transitions: Transition {
184 PropertyAnimation { target: canvas; properties: "y"; easing.type: Easing.InOutQuad }201 PropertyAnimation { target: canvas; properties: "y"; easing.type: Easing.InOutQuad }
185 }202 }
186}
187203
204} // canvas
205} // OrientationHelper
206} // fullScreenItem
188207
=== removed file 'qml/RotationHelper.qml'
--- qml/RotationHelper.qml 2013-08-09 15:22:29 +0000
+++ qml/RotationHelper.qml 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtQuick.Window 2.0
19
20Item {
21 id: rotationHelper
22
23 property string __rotationString: Screen.angleBetween(Screen.primaryOrientation, contentOrientation).toString();
24
25 rotation: Screen.angleBetween(Screen.primaryOrientation, contentOrientation);
26
27 anchors.fill: parent
28
29 Item {
30 state: __rotationString
31
32 states: [
33 State {
34 name: "270"
35 PropertyChanges {
36 target: rotationHelper
37 anchors {
38 leftMargin: (parent.width - parent.height) / 2
39 rightMargin: anchors.leftMargin
40 topMargin: -anchors.leftMargin
41 bottomMargin: anchors.topMargin
42 }
43 }
44 },
45 State {
46 name: "90"
47 PropertyChanges {
48 target: rotationHelper
49 anchors {
50 leftMargin: (parent.width - parent.height) / 2
51 rightMargin: anchors.leftMargin
52 topMargin: -anchors.leftMargin
53 bottomMargin: anchors.topMargin
54 }
55 }
56 }
57 ]
58 }
59}
600
=== modified file 'qml/qml.pro'
--- qml/qml.pro 2013-09-07 07:55:28 +0000
+++ qml/qml.pro 2013-09-09 08:52:28 +0000
@@ -24,7 +24,6 @@
24 maliit-magnifier.qml \24 maliit-magnifier.qml \
25 Keyboard.qml \25 Keyboard.qml \
26 maliit-ui-constants.qml \26 maliit-ui-constants.qml \
27 RotationHelper.qml \
28 WordRibbon.qml \27 WordRibbon.qml \
29 Popper.qml \28 Popper.qml \
30 KeyboardContainer.qml \29 KeyboardContainer.qml \
3130
=== modified file 'src/plugin/inputmethod.cpp'
--- src/plugin/inputmethod.cpp 2013-09-03 11:14:53 +0000
+++ src/plugin/inputmethod.cpp 2013-09-09 08:52:28 +0000
@@ -85,6 +85,7 @@
85 Q_D(InputMethod);85 Q_D(InputMethod);
8686
87 d->view->setSource(QUrl::fromLocalFile(g_maliit_keyboard_qml));87 d->view->setSource(QUrl::fromLocalFile(g_maliit_keyboard_qml));
88 d->view->setGeometry(qGuiApp->primaryScreen()->geometry());
8889
89 // FIXME: Reconnect feedback instance.90 // FIXME: Reconnect feedback instance.
90 Setup::connectAll(&d->layout.event_handler, &d->layout.updater, &d->editor);91 Setup::connectAll(&d->layout.event_handler, &d->layout.updater, &d->editor);
@@ -451,7 +452,7 @@
451 switch (status) {452 switch (status) {
452 case QQuickView::Ready:453 case QQuickView::Ready:
453 {454 {
454 d->qmlRootItem = qobject_cast<QQuickItem*> (d->view->rootObject());455 d->qmlRootItem = d->view->rootObject()->findChild<QQuickItem*>("ubuntuKeyboard");
455 QObject::connect(d->qmlRootItem, SIGNAL(hideAnimationFinishedChanged()), this, SLOT(onHideAnimationFinished()));456 QObject::connect(d->qmlRootItem, SIGNAL(hideAnimationFinishedChanged()), this, SLOT(onHideAnimationFinished()));
456 }457 }
457 break;458 break;
458459
=== modified file 'src/plugin/inputmethod_p.h'
--- src/plugin/inputmethod_p.h 2013-09-03 11:14:53 +0000
+++ src/plugin/inputmethod_p.h 2013-09-09 08:52:28 +0000
@@ -195,15 +195,16 @@
195195
196 keyboardVisibleRect = windowGeometryRect.adjusted(0,uiConst->invisibleTouchAreaHeight(orientation),0,0);196 keyboardVisibleRect = windowGeometryRect.adjusted(0,uiConst->invisibleTouchAreaHeight(orientation),0,0);
197197
198 qmlRootItem->setProperty("height", windowGeometryRect.height());
199 qmlRootItem->setProperty("keypadHeight", keyboardVisibleRect.height());
200 qmlRootItem->setProperty("contentOrientation", screenOrientation);
201
198 // qpa does not rotate the coordinate system202 // qpa does not rotate the coordinate system
199 windowGeometryRect = qGuiApp->primaryScreen()->mapBetween(203 windowGeometryRect = qGuiApp->primaryScreen()->mapBetween(
200 screenOrientation,204 screenOrientation,
201 qGuiApp->primaryScreen()->primaryOrientation(),205 qGuiApp->primaryScreen()->primaryOrientation(),
202 windowGeometryRect);206 windowGeometryRect);
203207
204
205 view->setGeometry(windowGeometryRect);
206
207 if (qmlRootItem->property("shown").toBool()) {208 if (qmlRootItem->property("shown").toBool()) {
208 host->setScreenRegion(QRegion(keyboardVisibleRect));209 host->setScreenRegion(QRegion(keyboardVisibleRect));
209210
@@ -212,8 +213,6 @@
212 host->setInputMethodArea(rect, view);213 host->setInputMethodArea(rect, view);
213 }214 }
214215
215 qmlRootItem->setProperty("contentOrientation", screenOrientation);
216
217 if (qmlRootItem->property("shown").toBool()) {216 if (qmlRootItem->property("shown").toBool()) {
218 applicationApiWrapper->reportOSKInvisible();217 applicationApiWrapper->reportOSKInvisible();
219218

Subscribers

People subscribed via source and target branches

to all changes: