diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-03-28 12:55:28 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-03-28 13:23:28 (GMT) |
commit | 5a6acc0ba1ed3b056f4c7a9c37481f4cb347a352 (patch) | |
tree | 1314513cfb2e377fd32a02118faa4eabc4b1c2ec /src/gui/kernel/qapplication_s60.cpp | |
parent | 5a14bf5050a6fb0b74341f08f33fc545f1408a2c (diff) | |
download | Qt-5a6acc0ba1ed3b056f4c7a9c37481f4cb347a352.zip Qt-5a6acc0ba1ed3b056f4c7a9c37481f4cb347a352.tar.gz Qt-5a6acc0ba1ed3b056f4c7a9c37481f4cb347a352.tar.bz2 |
Show softkeys when opening a dialog that has a fullscreen parent.
Now shows the CBA for each window that defines softkeys even if
topmost parent is fullscreen.
Task-number: QTBUG-4953
Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 5071cb5..0427ae4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1271,15 +1271,36 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowIcon_sys(true); qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 - // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. - QWidget *const window = qwidget->window(); - if (!window->parentWidget()) { // Only top level native windows have control over cba/status pane - const bool decorationsVisible = !(window->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); - const bool statusPaneVisibility = decorationsVisible; - const bool isFullscreen = window->windowState() & Qt::WindowFullScreen; - const bool cbaVisibilityHint = window->windowFlags() & Qt::WindowSoftkeysVisibleHint; - const bool buttonGroupVisibility = (decorationsVisible || (isFullscreen && cbaVisibilityHint)); - S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); + if (qwidget->isWindow()) { + QWidget *const window = qwidget->window(); + QWidget *parentWindow = window->parentWidget(); + if (parentWindow) { + while (parentWindow->parentWidget()) + parentWindow = parentWindow->parentWidget(); + } else { + parentWindow = window; + } + + const bool parentDecorationsVisible = !(parentWindow->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); + const bool parentIsFullscreen = parentWindow->windowState() & Qt::WindowFullScreen; + const bool parentCbaVisibilityHint = parentWindow->windowFlags() & Qt::WindowSoftkeysVisibleHint; + bool buttonGroupVisibility = (parentDecorationsVisible || (parentIsFullscreen && parentCbaVisibilityHint)); + + // For non-toplevel normal and maximized windows, show cba if window has softkey + // actions even if topmost parent is not showing cba. Do the same for fullscreen + // windows that request it. + if (!buttonGroupVisibility + && window->parentWidget() + && !(window->windowState() & Qt::WindowMinimized) + && ((window->windowFlags() & Qt::WindowSoftkeysVisibleHint) || !(window->windowState() & Qt::WindowFullScreen))) { + for (int i = 0; i < window->actions().size(); ++i) { + if (window->actions().at(i)->softKeyRole() != QAction::NoSoftKey) { + buttonGroupVisibility = true; + break; + } + } + } + S60->setStatusPaneAndButtonGroupVisibility(parentDecorationsVisible, buttonGroupVisibility); } #endif } else if (QApplication::activeWindow() == qwidget->window()) { |