- progress->setGeometry(QRect(0, 0, e->size().width(), PROGRESS_HEIGHT));
- qDebug() << "Toolbar height" << toolBar->height();
-#ifdef Q_WS_MAEMO_5
- previousButton->setGeometry(0,
- e->size().height() - toolBar->height() - TranslucentButton::pixels,
- TranslucentButton::pixels, TranslucentButton::pixels);
- nextButton->setGeometry(e->size().width() - TranslucentButton::pixels, 0,
- TranslucentButton::pixels, TranslucentButton::pixels);
-#else
- previousButton->setGeometry(0, e->size().height() - TranslucentButton::pixels,
- TranslucentButton::pixels, TranslucentButton::pixels);
- nextButton->setGeometry(e->size().width() - TranslucentButton::pixels,
- toolBar->height(), TranslucentButton::pixels, TranslucentButton::pixels);
-#endif // Q_WS_MAEMO_5
- qDebug() << "previousButton geometry" << previousButton->geometry();
- previousButton->flash(1500);
- nextButton->flash(1500);
- QMainWindow::resizeEvent(e);
+#ifdef Q_OS_SYMBIAN
+ // Tool bar is only useful in portrait mode
+ bool isPortrait =
+ (QApplication::desktop()->width() < QApplication::desktop()->height());
+ toolBar->setVisible(isPortrait);
+#endif
+ QTimer::singleShot(100, this, SLOT(placeChildren()));
+ AdopterWindow::resizeEvent(e);
+}
+
+void MainWindow::placeChildren()
+{
+ Trace t("MainWindow::placeChildren");
+
+ int toolBarHeight = 0;
+
+#ifdef Q_OS_SYMBIAN
+ // Tool bar is only useful in portrait mode
+ bool isPortrait =
+ (QApplication::desktop()->width() < QApplication::desktop()->height());
+ // toolBar->setVisible(isPortrait);
+
+ // Work around Symbian bug: If there is no tool bar, increase decorator
+ // widgets' Y coordinates
+ if (!isPortrait) {
+ toolBarHeight = toolBar->height();
+ }
+#endif // Q_OS_SYMBIAN
+
+ if (hasChild(view)) {
+ QRect geo = centralWidget()->geometry();
+ qDebug() << "centralWidget (MainWindow::resizeEvent)" << geo;
+#ifdef Q_OS_SYMBIAN
+ // FIXME: When returning from full screen in landscape mode,
+ // the central widget's height is miscalculated on Symbian.
+ // My apologies for this kludge
+ if (geo.height() == 288) {
+ geo.setHeight(223);
+ }
+#endif // Q_OS_SYMBIAN
+ progress->setGeometry(geo.x(),
+ geo.y() + geo.height() - progress->thickness() + toolBarHeight,
+ geo.width(), progress->thickness());
+ previousButton->setGeometry(geo.x(),
+ geo.y() + geo.height() - TranslucentButton::pixels + toolBarHeight,
+ TranslucentButton::pixels, TranslucentButton::pixels);
+ nextButton->setGeometry(
+ geo.x() + geo.width() - TranslucentButton::pixels,
+ geo.y(), TranslucentButton::pixels, TranslucentButton::pixels);
+ progress->flash();
+ previousButton->flash();
+ nextButton->flash();
+ qDebug() << "Progress (MainWindow::resizeEvent)"
+ << progress->geometry();
+ }
+