From 8113f2d94afd4e25caf12edf9716b7e0a82de1a8 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 1 Mar 2010 10:21:25 +0200 Subject: Added orientation change support for show/showNormal widgets in S60. Earlier the widget normalGeometry was calculated once when widget was made visible first time. Because geometry was not recalculated the widget displayed with show/showNormal did not change its location or size as a result of orientation change. This lead to unefficient screen usage. This commit makes widget to recalculate its normalGeometry as a result of orientation change, if developer has not set the widget position or size explicitly. Task-number: QTBUG-8551 Reviewed-by: Jason Barron --- src/gui/kernel/qapplication_s60.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index cf8ce62..2a90ba6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1029,6 +1029,16 @@ void QSymbianControl::HandleResourceChange(int resourceType) } else if (qwidget->isMaximized()) { TRect r = static_cast(S60->appUi())->ClientRect(); SetExtent(r.iTl, r.Size()); + } else if (!qwidget->isMinimized()){ // Normal geometry + if (!qwidget->testAttribute(Qt::WA_Resized)) { + qwidget->adjustSize(); + qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize + } + if (!qwidget->testAttribute(Qt::WA_Moved)) { + TRect r = static_cast(S60->appUi())->ClientRect(); + SetPosition(r.iTl); + qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position + } } break; } -- cgit v0.12