diff options
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 086cfec..5ac9803 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -134,7 +134,7 @@ void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, boo s->MakeVisible(statusPaneVisible); } if (buttonGroupVisibilityChanged || statusPaneVisibilityChanged) { - const QSize size = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect()).size(); + const QSize size = qt_TRect2QRect(S60->clientRect()).size(); const QSize oldSize; // note that QDesktopWidget::resizeEvent ignores the QResizeEvent contents QResizeEvent event(size, oldSize); QApplication::instance()->sendEvent(QApplication::desktop(), &event); @@ -231,6 +231,28 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible) } } +TRect QS60Data::clientRect() +{ + TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + if (S60->partialKeyboardOpen) { + // Adjust client rect when splitview is open, since for some curious reason + // native side insists that clientRect starts from (0,0) even though status + // pane might be visible. + TRect statusPaneRect; + TRect mainRect; + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect); + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainRect); + int clientAreaHeight = mainRect.Height(); + CEikStatusPane *const s = S60->statusPane(); + if (s && s->IsVisible()) + r.Move(0, statusPaneRect.Height()); + else + clientAreaHeight += statusPaneRect.Height(); + r.SetHeight(clientAreaHeight); + } + return r; +} + bool qt_nograb() // application no-grab option { #if defined(QT_DEBUG) @@ -908,6 +930,15 @@ TKeyResponse QSymbianControl::sendSymbianKeyEvent(const TKeyEvent &keyEvent, QEv } Qt::KeyboardModifiers mods = mapToQtModifiers(keyEvent.iModifiers); + + TInt code = keyEvent.iCode; + + if (mods == Qt::ControlModifier) { + //only support ctrl+a .. ctrl+z, 0x40 is the key value before Qt::Key_A + if (code > 0 && code < 27) + keyCode = 0x40 + code; + } + QKeyEventEx qKeyEvent(type, keyCode, mods, qt_keymapper_private()->translateKeyEvent(keyCode, mods), (keyEvent.iRepeats != 0), 1, keyEvent.iScanCode, s60Keysym, keyEvent.iModifiers); QWidget *widget; @@ -1435,7 +1466,9 @@ void QSymbianControl::handleClientAreaChange() if (qwidget->isFullScreen() && !cbaVisibilityHint) { SetExtentToWholeScreen(); } else if (qwidget->isMaximized() || (qwidget->isFullScreen() && cbaVisibilityHint)) { - TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + // Note that if there is S60->splitViewLastWidget, it means the resizing is done + // by input context handling and we can use just default ClientRect. + TRect r = (!S60->splitViewLastWidget) ? S60->clientRect() : static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); SetExtent(r.iTl, r.Size()); } else if (!qwidget->isMinimized()) { // Normal geometry if (!qwidget->testAttribute(Qt::WA_Resized)) { @@ -1443,7 +1476,7 @@ void QSymbianControl::handleClientAreaChange() qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize } if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) { - TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + TRect r = S60->clientRect(); SetPosition(r.iTl); qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position } @@ -1489,13 +1522,14 @@ void QSymbianControl::HandleResourceChange(int resourceType) if (!ic) { ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext()); } - if (ic && isSplitViewWidget(widget)) { + if (ic) { if (resourceType == KSplitViewCloseEvent) { S60->partialKeyboardOpen = false; ic->resetSplitViewWidget(); } else { S60->partialKeyboardOpen = true; - ic->ensureFocusWidgetVisible(widget); + if (isSplitViewWidget(widget)) + ic->ensureFocusWidgetVisible(widget); } } } @@ -1508,7 +1542,8 @@ void QSymbianControl::HandleResourceChange(int resourceType) // client area. if (S60->statusPane() && (S60->statusPane()->IsVisible() || m_lastStatusPaneVisibility)) { m_lastStatusPaneVisibility = S60->statusPane()->IsVisible(); - handleClientAreaChange(); + if (S60->handleStatusPaneResizeNotifications) + handleClientAreaChange(); } if (IsFocused() && IsVisible()) { qwidget->d_func()->setWindowIcon_sys(true); @@ -1912,7 +1947,7 @@ void qt_cleanup() qt_S60Beep = 0; } QFontCache::cleanup(); // Has to happen now, since QFontEngineS60 has FBS handles - QPixmapCache::clear(); // Has to happen now, since QS60PixmapData has FBS handles + QPixmapCache::clear(); // Has to happen now, since QSymbianRasterPixmapData has FBS handles #ifdef QT_NO_FREETYPE qt_cleanup_symbianFontDatabase(); |