diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-06-24 09:52:41 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-06-24 09:52:41 (GMT) |
commit | cf2f72f4f61f3a9e0e7573379c33bb341eeba7be (patch) | |
tree | 06fbd459f62f87344e7db973a0a9f3050cece825 /src/gui/inputmethod | |
parent | 164728f711136356a6c3482f762321b01c9d82dd (diff) | |
parent | 705b0f958a6071341b10cbd51917e1378356491b (diff) | |
download | Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.zip Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.gz Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/gui/image/qpixmap_raster_symbian.cpp
src/gui/image/qpixmapdatafactory.cpp
src/gui/painting/qgraphicssystem.cpp
src/gui/styles/qs60style.cpp
src/network/bearer/qnetworkconfigmanager_p.h
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtOpenGLu.def
src/s60installs/bwins/QtOpenVGu.def
src/s60installs/eabi/QtGuiu.def
src/s60installs/eabi/QtOpenVGu.def
tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index d603540..f8d7e28 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -366,7 +366,8 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE } if (event->type() == QSymbianEvent::ResourceChangeEvent - && event->resourceChangeType() == KEikMessageFadeAllWindows) { + && (event->resourceChangeType() == KEikMessageFadeAllWindows + || event->resourceChangeType() == KEikDynamicLayoutVariantSwitch)) { reset(); } @@ -467,7 +468,10 @@ void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget) } } else { if (m_splitViewResizeBy) - gv->resize(gv->rect().width(), m_splitViewResizeBy); + if (m_splitViewPreviousWindowStates & Qt::WindowFullScreen) + gv->resize(gv->rect().width(), qApp->desktop()->height()); + else + gv->resize(gv->rect().width(), m_splitViewResizeBy); } // Resizing might have led to widget losing its original windowstate. // Restore previous window state. @@ -699,11 +703,6 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) } else if (anynumbermodes) { flags |= EAknEditorNumericInputMode; - if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0 - && ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly))) { - //workaround - the * key does not launch the symbols menu, making it impossible to use these modes unless text mode is enabled. - flags |= EAknEditorTextInputMode; - } } else if (anytextmodes) { flags |= EAknEditorTextInputMode; @@ -784,8 +783,6 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG); } else if (needsCharMap) { m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); - } else if ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly)) { - m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); } else { m_fepState->SetSpecialCharacterTableResourceId(0); } @@ -896,19 +893,40 @@ void QCoeFepInputContext::translateInputWidget() m_transformation = (rootItem->transform().isTranslating()) ? QRectF(0,0, gv->width(), rootItem->transform().dy()) : QRectF(); - // Do nothing if the cursor is visible in the splitview area. - if (splitViewRect.contains(cursorP.boundingRect())) + // Adjust cursor bounding rect to be lower, so that view translates if the cursor gets near + // the splitview border. + QRect cursorRect = cursorP.boundingRect().adjusted(0, cursor.height(), 0, cursor.height()); + if (splitViewRect.contains(cursorRect)) return; - // New Y position should be ideally at the center of the splitview area. - // If that would expose unpainted canvas, limit the tranformation to the visible scene bottom. - - const qreal maxY = gv->sceneRect().bottom() - splitViewRect.bottom() + m_transformation.height(); - qreal dy = -(qMin(maxY, (cursor.bottom() - vkbRect.top() / 2))); - - // Do not allow transform above screen top. - if (m_transformation.height() + dy > 0) + // New Y position should be ideally just above the keyboard. + // If that would expose unpainted canvas, limit the tranformation to the visible scene rect or + // to the focus item's shape/clip path. + + const QPainterPath path = gv->scene()->focusItem()->isClipped() ? + gv->scene()->focusItem()->clipPath() : gv->scene()->focusItem()->shape(); + const qreal itemHeight = path.boundingRect().height(); + + // Limit the maximum translation so that underlaying window content is not exposed. + qreal maxY = gv->sceneRect().bottom() - splitViewRect.bottom(); + maxY = m_transformation.height() ? (qMin(itemHeight, maxY) + m_transformation.height()) : maxY; + if (maxY < 0) + maxY = 0; + + // Translation should happen row-by-row, but initially it needs to ensure that cursor is visible. + const qreal translation = m_transformation.height() ? + cursor.height() : (cursorRect.bottom() - vkbRect.top()); + const qreal dy = -(qMin(maxY, translation)); + + // Do not allow transform above screen top, nor beyond scenerect + if (m_transformation.height() + dy > 0 || gv->sceneRect().bottom() + m_transformation.height() < 0) { + // If we already have some transformation, remove it. + if (m_transformation.height() < 0 || gv->sceneRect().bottom() + m_transformation.height() < 0) { + rootItem->resetTransform(); + translateInputWidget(); + } return; + } rootItem->setTransform(QTransform::fromTranslate(0, dy), true); } |