summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-06-17 12:23:09 +0300
committerSami Merila <sami.merila@nokia.com>2011-06-17 12:23:09 +0300
commitb133f1b45638dd10bd5400393d83ca1bed1985c4 (patch)
tree55ff2272ed8a4c23c98c2f81870e2f3b2589b284 /src/gui/inputmethod
parentbe24f3c83e03118fb2dba3e59db44b1f600a6a63 (diff)
Ensure visibility of input widget in QML app when doing layout switch
When QML application changes orientation, it usually switches to a new layout that lays out widgets differently (ie. in portrait, one vertical column; in landscape, horizontal multi-column layout). This easily breaks splitview translation logic, since it tries to ensure the visibility of the input widget before the new layout has been applied. Additionally, the logic failed, when connected signal was fired, since it assumed that the new translation would have translated the view above from where it started from (i.e. window below the translated view would have been exposed) and thus, it didn't do anything. As a fix, when translation logic seems to indicate that the translation would fail (and thus previously wouldn't do anything), reset the existing translation and try again. Task-number: QTBUG-16785 Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 3a12d2693f..fcb809c653 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -912,8 +912,14 @@ void QCoeFepInputContext::translateInputWidget()
qreal dy = -(qMin(maxY, (cursor.bottom() - vkbRect.top() / 2)));
// Do not allow transform above screen top.
- if (m_transformation.height() + dy > 0)
+ if (m_transformation.height() + dy > 0) {
+ // If we already have some transformation, remove it.
+ if (m_transformation.height() < 0) {
+ rootItem->resetTransform();
+ translateInputWidget();
+ }
return;
+ }
rootItem->setTransform(QTransform::fromTranslate(0, dy), true);
}