From b133f1b45638dd10bd5400393d83ca1bed1985c4 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 17 Jun 2011 12:23:09 +0300 Subject: 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 --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 3a12d26..fcb809c 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); } -- cgit v0.12