+bool AdopterWindow::portrait()
+{
+ QRect geometry = QApplication::desktop()->geometry();
+ return geometry.width() < geometry.height();
+}
+
+void AdopterWindow::placeDecorations()
+{
+ Trace t("AdopterWindow::placeDecorations");
+
+#ifdef Q_OS_SYMBIAN
+ if (toolBar) {
+ if (portrait()) {
+ qDebug() << "Show tool bar";
+ toolBar->setVisible(true);
+ } else {
+ qDebug() << "Hide tool bar";
+ toolBar->setVisible(false);
+ }
+ }
+#endif // Q_OS_SYMBIAN
+
+ if (!hasBookView()) {
+ return;
+ }
+
+ int toolBarHeight = 0;
+
+ QRect geo = bookView->geometry();
+ qDebug() << "bookView:" << geo;
+
+#ifdef Q_OS_SYMBIAN
+ // Work around Symbian bug: If tool bar is hidden, increase bottom
+ // decorator widgets' Y coordinates by the tool bar's height
+ if (!portrait() && toolBar) {
+ toolBarHeight = toolBar->height();
+ }
+
+ // Work around another Symbian bug: When returning from full screen mode
+ // in landscape, the book view widget's height is miscalculated.
+ // My apologies for this kludge
+ if (geo.height() == 288) {
+ qDebug() << "Adjusting bottom Y";
+ toolBarHeight -= 288 - 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:" << progress->geometry();
+}