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
1=== modified file 'src/plugin/inputmethod.cpp'
2--- src/plugin/inputmethod.cpp 2013-09-26 10:55:56 +0000
3+++ src/plugin/inputmethod.cpp 2013-09-30 12:07:33 +0000
4@@ -111,7 +111,7 @@
5
6 // Setting layout orientation depends on word engine and hide word ribbon
7 // settings to be initialized first:
8- d->updateKeyboardOrientation();
9+ d->setLayoutOrientation(d->appsCurrentOrientation);
10 }
11
12 InputMethod::~InputMethod()
13@@ -216,20 +216,19 @@
14 {
15 Q_D(InputMethod);
16
17- Qt::ScreenOrientation orientation = Qt::PortraitOrientation;
18 switch (angle) {
19 case 0:
20- orientation = Qt::LandscapeOrientation; break;
21+ d->appsCurrentOrientation = Qt::LandscapeOrientation; break;
22 case 90:
23- orientation = Qt::InvertedPortraitOrientation; break;
24+ d->appsCurrentOrientation = Qt::InvertedPortraitOrientation; break;
25 case 180:
26- orientation = Qt::InvertedLandscapeOrientation; break;
27+ d->appsCurrentOrientation = Qt::InvertedLandscapeOrientation; break;
28 case 270:
29 default:
30- orientation = Qt::PortraitOrientation; break;
31+ d->appsCurrentOrientation = Qt::PortraitOrientation; break;
32 }
33
34- d->setLayoutOrientation(orientation);
35+ d->setLayoutOrientation(d->appsCurrentOrientation);
36 }
37
38 bool InputMethod::imExtensionEvent(MImExtensionEvent *event)
39@@ -340,7 +339,7 @@
40 Q_UNUSED(orientation);
41 Q_D(InputMethod);
42
43- d->updateKeyboardOrientation();
44+ d->setLayoutOrientation(d->appsCurrentOrientation);
45 }
46
47 void InputMethod::update()
48
49=== modified file 'src/plugin/inputmethod_p.h'
50--- src/plugin/inputmethod_p.h 2013-09-26 10:55:56 +0000
51+++ src/plugin/inputmethod_p.h 2013-09-30 12:07:33 +0000
52@@ -91,6 +91,7 @@
53 bool predictionEnabled;
54 Maliit::TextContentType contentType;
55 QString activeLanguageId;
56+ Qt::ScreenOrientation appsCurrentOrientation;
57
58 KeyboadSettings m_settings;
59
60@@ -111,6 +112,7 @@
61 , predictionEnabled(false)
62 , contentType(Maliit::FreeTextContentType)
63 , activeLanguageId("en_us")
64+ , appsCurrentOrientation(qGuiApp->primaryScreen()->orientation())
65 , m_settings()
66 {
67 view = createWindow(host);
68@@ -237,18 +239,13 @@
69 }
70 }
71
72- void updateKeyboardOrientation()
73- {
74- setLayoutOrientation(QGuiApplication::primaryScreen()->orientation());
75- }
76-
77 void updateWordRibbon()
78 {
79 layout.helper.wordRibbon()->setEnabled( predictionEnabled );
80 Q_EMIT q->wordRibbonEnabledChanged( predictionEnabled );
81 qmlRootItem->setProperty("wordribbon_visible", predictionEnabled );
82
83- updateKeyboardOrientation();
84+ setLayoutOrientation(appsCurrentOrientation);
85 }
86
87 /*
88@@ -342,10 +339,6 @@
89 void onScreenSizeChange(const QSize &size)
90 {
91 layout.helper.setScreenSize(size);
92-
93- #ifdef TEMP_DISABLED
94- updateKeyboardOrientation();
95- #endif
96 }
97
98 void closeOskWindow()

Subscribers

People subscribed via source and target branches