From b1cc0f58970cc07f81671f200d13d9182dce3370 Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Tue, 20 Apr 2010 10:27:49 +0200 Subject: Tweak the 'normalGeometry' of the widget before setting it. If a widget is initially shown as maximized or fullscreen then the normal geometry is calculated before the status pane has been created. When returning to the "Normal" window state the geometry needs to be tweaked to compensate the fact that there is a status present now. This should only happen if the application has not been given an explicit position. Reviewed-by: Janne Anttila --- src/gui/kernel/qwidget_s60.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index cae38f5..7fd9289 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1149,8 +1149,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) adjustSize(); QTLWExtra *top = d->topData(); - const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry; - + QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry; const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint; if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint) { @@ -1159,6 +1158,16 @@ void QWidget::setWindowState(Qt::WindowStates newstate) TRect maxExtent = qt_QRect2TRect(qApp->desktop()->availableGeometry(this)); window->SetExtent(maxExtent.iTl, maxExtent.Size()); } else { +#ifdef Q_WS_S60 + // With delayed creation of S60 app panes, the normalGeometry calculated above is not + // accurate because it did not consider the status pane. This means that when returning + // normal mode after showing the status pane, the geometry would overlap so we should + // move it if it never had an explicit position. + if (!wasMoved && statusPane && visible) { + TPoint tl = static_cast(S60->appUi())->ClientRect().iTl; + normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY)); + } +#endif setGeometry(normalGeometry); } -- cgit v0.12