summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-22 08:17:17 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-23 08:37:37 (GMT)
commitae3d95f872c8bd2e192c58d7c7c830a3d2e4bc43 (patch)
tree9f2e7843f54a1769bb9e3906c8bc9c66afee2e35 /src/gui
parent253d075996818ba6d42e0caf9e03271e386621d0 (diff)
downloadQt-ae3d95f872c8bd2e192c58d7c7c830a3d2e4bc43.zip
Qt-ae3d95f872c8bd2e192c58d7c7c830a3d2e4bc43.tar.gz
Qt-ae3d95f872c8bd2e192c58d7c7c830a3d2e4bc43.tar.bz2
Fixed 'fullsreen with softkeys' mode not to expand under softkey area.
availableGeometry returns incorrect area after cba is made invisible, it seems that this happens because CAknToolbar is not made invisible. Fixed the problem by reverting back to SetExtentToWholeScreen usage when the widget is really fullscreen, i.e. Qt::WindowSoftkeysVisibleHint is not set. Task-number: QTBUG-9038 Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp45
-rw-r--r--src/gui/kernel/qt_s60_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp8
3 files changed, 29 insertions, 25 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index e7a7093..37d1b62 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1004,16 +1004,32 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
// else { We don't touch the active window unless we were explicitly activated or deactivated }
}
+void QSymbianControl::handleClientAreaChange()
+{
+ const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint;
+ if (qwidget->isFullScreen() && !cbaVisibilityHint) {
+ SetExtentToWholeScreen();
+ } else if (qwidget->isMaximized() || (qwidget->isFullScreen() && cbaVisibilityHint)) {
+ TRect r = static_cast<CEikAppUi*>(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) && qwidget->windowType() != Qt::Dialog) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ SetPosition(r.iTl);
+ qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
+ }
+ }
+}
+
void QSymbianControl::HandleResourceChange(int resourceType)
{
switch (resourceType) {
case KInternalStatusPaneChange:
- if (qwidget->isFullScreen()) {
- SetExtentToWholeScreen();
- } else if (qwidget->isMaximized()) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- SetExtent(r.iTl, r.Size());
- }
+ handleClientAreaChange();
if (IsFocused() && IsVisible()) {
qwidget->d_func()->setWindowIcon_sys(true);
qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
@@ -1025,22 +1041,7 @@ void QSymbianControl::HandleResourceChange(int resourceType)
#ifdef Q_WS_S60
case KEikDynamicLayoutVariantSwitch:
{
- if (qwidget->isFullScreen()) {
- SetExtentToWholeScreen();
- } else if (qwidget->isMaximized()) {
- TRect r = static_cast<CEikAppUi*>(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) && qwidget->windowType() != Qt::Dialog) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
- SetPosition(r.iTl);
- qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
- }
- }
+ handleClientAreaChange();
break;
}
#endif
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index cedede1..7c6b754 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -212,6 +212,7 @@ private:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
+ void handleClientAreaChange();
private:
static QSymbianControl *lastFocusedControl;
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 79702af..bfa7050 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1109,9 +1109,11 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
QTLWExtra *top = d->topData();
const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
- if (newstate & Qt::WindowFullScreen)
- setGeometry(qApp->desktop()->availableGeometry(this));
- else if (newstate & Qt::WindowMaximized)
+
+ const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint;
+ if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint)
+ setGeometry(qApp->desktop()->screenGeometry(this));
+ else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint))
setGeometry(qApp->desktop()->availableGeometry(this));
else
setGeometry(normalGeometry);