diff options
author | Jason Barron <jbarron@trolltech.com> | 2010-04-20 08:27:49 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2010-04-21 07:41:00 (GMT) |
commit | b1cc0f58970cc07f81671f200d13d9182dce3370 (patch) | |
tree | f905c586b0ff63f60e131ce89ee2c2730e14f2d7 | |
parent | 904d205b8d69b341aa8f25dbb7a7871e6f56c2ef (diff) | |
download | Qt-b1cc0f58970cc07f81671f200d13d9182dce3370.zip Qt-b1cc0f58970cc07f81671f200d13d9182dce3370.tar.gz Qt-b1cc0f58970cc07f81671f200d13d9182dce3370.tar.bz2 |
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
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 13 |
1 files 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<CEikAppUi*>(S60->appUi())->ClientRect().iTl; + normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY)); + } +#endif setGeometry(normalGeometry); } |