Fix forward navigation control on Linux.
[dorian] / fullscreenwindow.cpp
index 07bf291..145b425 100644 (file)
@@ -9,17 +9,13 @@
 
 static const int MARGIN = 9;
 
-FullScreenWindow::FullScreenWindow(QWidget *parent):
-        AdopterWindow(parent), progress(0), previousButton(0), nextButton(0)
+FullScreenWindow::FullScreenWindow(QWidget *parent): AdopterWindow(parent)
 {
     TRACE;
-    Q_ASSERT(parent);
-#ifdef Q_WS_MAEMO_5
+
+#if defined(Q_WS_MAEMO_5)
     setAttribute(Qt::WA_Maemo5StackedWindow, true);
     setAttribute(Qt::WA_Maemo5NonComposited, true);
-#endif // Q_WS_MAEMO_5
-#ifndef Q_OS_SYMBIAN
-    toolBar->hide();
 #endif
     QFrame *frame = new QFrame(this);
     QVBoxLayout *layout = new QVBoxLayout(frame);
@@ -36,32 +32,26 @@ FullScreenWindow::FullScreenWindow(QWidget *parent):
     connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore()));
 }
 
-void FullScreenWindow::showFullScreen()
+void FullScreenWindow::showEvent(QShowEvent *e)
 {
-    Trace t("FullScreenWindow::showFullScreen");
-    AdopterWindow::showFullScreen();
+    Trace t("FullScreenWindow::showEvent");
+    qDebug() << "Softkeys visible?"
+             << (windowFlags() & Qt::WindowSoftkeysVisibleHint);
     placeChildren();
+    AdopterWindow::showEvent(e);
 }
 
 void FullScreenWindow::resizeEvent(QResizeEvent *e)
 {
     Trace t("FullScreenWindow::resizeEvent");
-    QTimer::singleShot(100, this, SLOT(placeChildren()));
+    placeChildren();
     AdopterWindow::resizeEvent(e);
 }
 
-void FullScreenWindow::takeChildren(BookView *view,
-                                    Progress *prog,
-                                    TranslucentButton *previous,
-                                    TranslucentButton *next)
+void FullScreenWindow::closeEvent(QCloseEvent *e)
 {
-    TRACE;
-    progress = prog;
-    previousButton = previous;
-    nextButton = next;
-    QList<QWidget *> otherChildren;
-    otherChildren << progress << previousButton << nextButton;
-    AdopterWindow::takeChildren(view, otherChildren);
+    Trace t("FullscreenWindow::closeEvent");
+    AdopterWindow::closeEvent(e);
 }
 
 void FullScreenWindow::placeChildren()
@@ -89,28 +79,5 @@ void FullScreenWindow::placeChildren()
         h - TranslucentButton::pixels - MARGIN,
         TranslucentButton::pixels,
         TranslucentButton::pixels);
-
-    if (hasChild(progress)) {
-        progress->setGeometry(0, h - progress->thickness(),
-                              w, progress->thickness());
-        qDebug() << "Screen (FullScreenWindow::resizeEvent)" << w << "x" << h;
-        qDebug() << "Progress (FullScreenWindow::resizeEvent)"
-                << progress->geometry();
-    }
-    if (hasChild(previousButton)) {
-        previousButton->setGeometry(
-                MARGIN,
-                h - TranslucentButton::pixels - MARGIN,
-                TranslucentButton::pixels,
-                TranslucentButton::pixels);
-    }
-    if (hasChild(nextButton)) {
-        nextButton->setGeometry(
-        w - TranslucentButton::pixels - MARGIN,
-        MARGIN,
-        TranslucentButton::pixels,
-        TranslucentButton::pixels);
-    }
-
     restoreButton->flash(3000);
 }