diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-07-27 15:23:52 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-07-28 14:37:44 (GMT) |
commit | 92d6d1c974206bac7520101ad26ca93eb0b4d977 (patch) | |
tree | 962ebd54cfe3a1134dcafea1e033d009f555722b /src/gui/kernel/qapplication_s60.cpp | |
parent | 859cca02a89ecadbb5578bb113e535374bcfcaca (diff) | |
download | Qt-92d6d1c974206bac7520101ad26ca93eb0b4d977.zip Qt-92d6d1c974206bac7520101ad26ca93eb0b4d977.tar.gz Qt-92d6d1c974206bac7520101ad26ca93eb0b4d977.tar.bz2 |
Ensure that window rectangle is updated when CBA visibility changes
In S60, there are two pieces of screen furniture, changes in whose
visibility or size can affect the size of the Qt application window.
These are the status pane, at the top of the screen, and the CBA at
the bottom.
QSymbianControl listens for changes in status pane visibility and
size by implementing MEikStatusPaneObserver. Notifications
received via this interface trigger a call to
QSymbianControl::handleClientAreaChange() which resizes the control.
There is no corresponding interface through which to receive
notifications of changes in CBA visibility.
This patch introduces a utility function for setting the visibility
of both the status pane and CBA, which ensures that the control's
rectangle is updated when either one changes.
Task-number: QTBUG-5320
Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 1c06100..e8ee2e4 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -112,6 +112,25 @@ QS60Data* qGlobalS60Data() return qt_s60Data(); } +#ifdef Q_WS_S60 +void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, bool buttonGroupVisible) +{ + bool buttonGroupVisibilityChanged = false; + if (CEikButtonGroupContainer *const b = buttonGroupContainer()) { + buttonGroupVisibilityChanged = (b->IsVisible() != buttonGroupVisible); + b->MakeVisible(buttonGroupVisible); + } + bool statusPaneVisibilityChanged = false; + if (CEikStatusPane *const s = statusPane()) { + statusPaneVisibilityChanged = (s->IsVisible() != statusPaneVisible); + s->MakeVisible(statusPaneVisible); + } + if (buttonGroupVisibilityChanged && !statusPaneVisibilityChanged) + // Ensure that control rectangle is updated + static_cast<QSymbianControl *>(QApplication::activeWindow()->winId())->handleClientAreaChange(); +} +#endif + bool qt_nograb() // application no-grab option { #if defined(QT_DEBUG) @@ -1100,17 +1119,12 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) 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. - CEikStatusPane *statusPane = S60->statusPane(); - CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer(); - TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); - if (statusPane) - statusPane->MakeVisible(visible); - if (buttonGroup) { - // Visibility - const TBool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; - const TBool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; - buttonGroup->MakeVisible(visible || (isFullscreen && cbaVisibilityHint)); - } + const bool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); + const bool statusPaneVisibility = visible; + const bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; + const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; + const bool buttonGroupVisibility = (visible || (isFullscreen && cbaVisibilityHint)); + S60->setStatusPaneAndButtonGroupVisibility(statusPaneVisibility, buttonGroupVisibility); #endif } else if (QApplication::activeWindow() == qwidget->window()) { if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog() || S60->menuBeingConstructed) { |