In progress...
authorU-NOE\polster <polster@4DKD01593.NOE.Nokia.com>
Thu, 30 Dec 2010 14:04:39 +0000 (15:04 +0100)
committerU-NOE\polster <polster@4DKD01593.NOE.Nokia.com>
Thu, 30 Dec 2010 14:04:39 +0000 (15:04 +0100)
adopterwindow.cpp
bookview.cpp
bookview.h

index 2cdf4dd..2230675 100644 (file)
@@ -135,17 +135,16 @@ void AdopterWindow::showEvent(QShowEvent *e)
 void AdopterWindow::resizeEvent(QResizeEvent *event)
 {
     Trace t("AdopterWindow::resizeEvent");
-#if defined(Q_OS_SYMBIAN)
-    if (bookView) {
-        bookView->setLastBookmark();
-    }
-#endif
     MainBase::resizeEvent(event);
     placeDecorations();
-#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
+#if defined(Q_WS_MAEMO_5)
     if (bookView) {
         QTimer::singleShot(110, bookView, SLOT(restoreLastBookmark()));
     }
+#elif defined(Q_OS_SYMBIAN)
+    if (bookView) {
+        QTimer::singleShot(110, bookView, SLOT(adjustPosition()));
+    }
 #endif
 }
 
index 3e38ea6..bda16e4 100644 (file)
@@ -514,13 +514,15 @@ void BookView::onMediaKeysPressed(MediaKeysObserver::MediaKeys key)
 
 #endif // Q_OS_SYMBIAN
 
-void BookView::adjustPosition(const QSize &size, const QSize &oldSize)
+void BookView::adjustPosition()
 {
+    QSize desktop = QApplication::desktop()->size();
+    qreal ratio = (qreal)(desktop.width()) / (qreal)(desktop.height());
     if (mBook) {
         QWebFrame *frame = page()->mainFrame();
         int height = frame->contentsSize().height();
         int pos = frame->scrollPosition().y();
-        qDebug() << QString("At %1 (%2%, height %3)").
-                arg(pos).arg((qreal)pos / (qreal)height * 100).arg(height);
+        qreal relativePos = (qreal)pos / (qreal)height;
+        // FIXME: Finish me
     }
 }
index 4a5e447..c636230 100644 (file)
@@ -91,7 +91,7 @@ public slots:
     void restoreLastBookmark();
 
     /** Adjust web view position after orientation change. */
-    void adjustPosition(const QSize &size, const QSize &oldSize);
+    void adjustPosition();
 
 protected slots:
 #ifdef Q_OS_SYMBIAN