From 15f6124da9c2cf70e74a1e0e6f89c27d17ec9d29 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 23 Dec 2010 15:53:43 +0200 Subject: Fix fullscreen/Maximized dialog misplacement in Symbian Task-number: QTBUG-16277 Reviewed-by: Sami Merila --- src/gui/dialogs/qdialog.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 16ea045..bcf952c 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -899,9 +899,21 @@ bool QDialog::symbianAdjustedPosition() { #if defined(Q_WS_S60) QPoint p; - const bool doS60Positioning = !(isFullScreen()||isMaximized()); - if (doS60Positioning) { - QPoint oldPos = pos(); + QPoint oldPos = pos(); + if (isFullScreen()) { + p.setX(0); + p.setY(0); + } else if (isMaximized()) { + TRect statusPaneRect = TRect(); + if (S60->screenHeightInPixels > S60->screenWidthInPixels) { + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect); + } else { + AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStaconTop, statusPaneRect); + } + + p.setX(0); + p.setY(statusPaneRect.Height()); + } else { // naive way to deduce screen orientation if (S60->screenHeightInPixels > S60->screenWidthInPixels) { int cbaHeight; @@ -937,10 +949,10 @@ bool QDialog::symbianAdjustedPosition() p.setX(qMax(0,S60->screenWidthInPixels - width())); } } - if (oldPos != p || p.y() < 0) - move(p); } - return doS60Positioning; + if (oldPos != p || p.y() < 0) + move(p); + return true; #else // TODO - check positioning requirement for Symbian, non-s60 return false; -- cgit v0.12