Add tool bar button to change orientation.
[dorian] / bookview.cpp
index c3b3166..b2e69c6 100644 (file)
@@ -463,6 +463,17 @@ void BookView::timerEvent(QTimerEvent *e)
     QWebView::timerEvent(e);
 }
 
+void BookView::hideEvent(QHideEvent *e)
+{
+    Trace t("BookView::hideEvent");
+
+#if defined(Q_OS_SYMBIAN)
+    setLastBookmark();
+#endif
+
+    QWebView::hideEvent(e);
+}
+
 void BookView::goPreviousPage()
 {
     QWebFrame *frame = page()->mainFrame();
@@ -516,20 +527,3 @@ void BookView::onMediaKeysPressed(MediaKeysObserver::MediaKeys key)
 }
 
 #endif // Q_OS_SYMBIAN
-
-void BookView::adjustPosition()
-{
-    TRACE;
-    const qreal portraitMagic = 1.66;
-    const qreal landscapeMagic = 0.655;
-    if (mBook) {
-        QSize desktop = QApplication::desktop()->size();
-        int screenHeight = desktop.height();
-        int screenWidth = desktop.width();
-        qreal ratio = (screenWidth<screenHeight)? portraitMagic: landscapeMagic;
-        QWebFrame *frame = page()->mainFrame();
-        int current = frame->scrollPosition().y();
-        qDebug() << "From" << current << "to" << (int)(current * ratio);
-        frame->scroll(0, (int)(current * ratio) - current);
-    }
-}