Merge lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-orientation-2 into lp:ubuntu-keyboard

Proposed by Thomas Moenicke
Status: Merged
Approved by: Günter Schwann
Approved revision: 49
Merged at revision: 51
Proposed branch: lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-orientation-2
Merge into: lp:ubuntu-keyboard
Diff against target: 98 lines (+10/-18)
2 files modified
src/plugin/inputmethod.cpp (+7/-8)
src/plugin/inputmethod_p.h (+3/-10)
To merge this branch: bzr merge lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-orientation-2
Reviewer Review Type Date Requested Status
Günter Schwann (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+188270@code.launchpad.net

Commit message

improves orientation changing behavior when osk is hidden, fixes #1213127

Description of the change

improves orientation changing behavior when osk is hidden, fixes #1213127

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

rebased to trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Thomas Moenicke (thomas-moenicke) wrote :

tested on tablet and galaxy nexus. Orientation works fine, OSK is at the edge of the screen also on tablet.

Revision history for this message
Günter Schwann (schwann) wrote :

looks good, and works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/plugin/inputmethod.cpp'
--- src/plugin/inputmethod.cpp 2013-09-26 10:55:56 +0000
+++ src/plugin/inputmethod.cpp 2013-09-30 12:07:33 +0000
@@ -111,7 +111,7 @@
111111
112 // Setting layout orientation depends on word engine and hide word ribbon112 // Setting layout orientation depends on word engine and hide word ribbon
113 // settings to be initialized first:113 // settings to be initialized first:
114 d->updateKeyboardOrientation();114 d->setLayoutOrientation(d->appsCurrentOrientation);
115}115}
116116
117InputMethod::~InputMethod()117InputMethod::~InputMethod()
@@ -216,20 +216,19 @@
216{216{
217 Q_D(InputMethod);217 Q_D(InputMethod);
218218
219 Qt::ScreenOrientation orientation = Qt::PortraitOrientation;
220 switch (angle) {219 switch (angle) {
221 case 0:220 case 0:
222 orientation = Qt::LandscapeOrientation; break;221 d->appsCurrentOrientation = Qt::LandscapeOrientation; break;
223 case 90:222 case 90:
224 orientation = Qt::InvertedPortraitOrientation; break;223 d->appsCurrentOrientation = Qt::InvertedPortraitOrientation; break;
225 case 180:224 case 180:
226 orientation = Qt::InvertedLandscapeOrientation; break;225 d->appsCurrentOrientation = Qt::InvertedLandscapeOrientation; break;
227 case 270:226 case 270:
228 default:227 default:
229 orientation = Qt::PortraitOrientation; break;228 d->appsCurrentOrientation = Qt::PortraitOrientation; break;
230 }229 }
231230
232 d->setLayoutOrientation(orientation);231 d->setLayoutOrientation(d->appsCurrentOrientation);
233}232}
234233
235bool InputMethod::imExtensionEvent(MImExtensionEvent *event)234bool InputMethod::imExtensionEvent(MImExtensionEvent *event)
@@ -340,7 +339,7 @@
340 Q_UNUSED(orientation);339 Q_UNUSED(orientation);
341 Q_D(InputMethod);340 Q_D(InputMethod);
342341
343 d->updateKeyboardOrientation();342 d->setLayoutOrientation(d->appsCurrentOrientation);
344}343}
345344
346void InputMethod::update()345void InputMethod::update()
347346
=== modified file 'src/plugin/inputmethod_p.h'
--- src/plugin/inputmethod_p.h 2013-09-26 10:55:56 +0000
+++ src/plugin/inputmethod_p.h 2013-09-30 12:07:33 +0000
@@ -91,6 +91,7 @@
91 bool predictionEnabled;91 bool predictionEnabled;
92 Maliit::TextContentType contentType;92 Maliit::TextContentType contentType;
93 QString activeLanguageId;93 QString activeLanguageId;
94 Qt::ScreenOrientation appsCurrentOrientation;
9495
95 KeyboadSettings m_settings;96 KeyboadSettings m_settings;
9697
@@ -111,6 +112,7 @@
111 , predictionEnabled(false)112 , predictionEnabled(false)
112 , contentType(Maliit::FreeTextContentType)113 , contentType(Maliit::FreeTextContentType)
113 , activeLanguageId("en_us")114 , activeLanguageId("en_us")
115 , appsCurrentOrientation(qGuiApp->primaryScreen()->orientation())
114 , m_settings()116 , m_settings()
115 {117 {
116 view = createWindow(host);118 view = createWindow(host);
@@ -237,18 +239,13 @@
237 }239 }
238 }240 }
239241
240 void updateKeyboardOrientation()
241 {
242 setLayoutOrientation(QGuiApplication::primaryScreen()->orientation());
243 }
244
245 void updateWordRibbon()242 void updateWordRibbon()
246 {243 {
247 layout.helper.wordRibbon()->setEnabled( predictionEnabled );244 layout.helper.wordRibbon()->setEnabled( predictionEnabled );
248 Q_EMIT q->wordRibbonEnabledChanged( predictionEnabled );245 Q_EMIT q->wordRibbonEnabledChanged( predictionEnabled );
249 qmlRootItem->setProperty("wordribbon_visible", predictionEnabled );246 qmlRootItem->setProperty("wordribbon_visible", predictionEnabled );
250247
251 updateKeyboardOrientation();248 setLayoutOrientation(appsCurrentOrientation);
252 }249 }
253250
254 /*251 /*
@@ -342,10 +339,6 @@
342 void onScreenSizeChange(const QSize &size)339 void onScreenSizeChange(const QSize &size)
343 {340 {
344 layout.helper.setScreenSize(size);341 layout.helper.setScreenSize(size);
345
346 #ifdef TEMP_DISABLED
347 updateKeyboardOrientation();
348 #endif
349 }342 }
350343
351 void closeOskWindow()344 void closeOskWindow()

Subscribers

People subscribed via source and target branches