From: U-NOE\polster Date: Thu, 30 Dec 2010 14:04:39 +0000 (+0100) Subject: In progress... X-Git-Url: http://git.maemo.org/git/?p=dorian;a=commitdiff_plain;h=d4cbc4dac9cc7cf159220ef56a9b1014c68b46c1 In progress... --- diff --git a/adopterwindow.cpp b/adopterwindow.cpp index 2cdf4dd..2230675 100644 --- a/adopterwindow.cpp +++ b/adopterwindow.cpp @@ -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 } diff --git a/bookview.cpp b/bookview.cpp index 3e38ea6..bda16e4 100644 --- a/bookview.cpp +++ b/bookview.cpp @@ -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 } } diff --git a/bookview.h b/bookview.h index 4a5e447..c636230 100644 --- a/bookview.h +++ b/bookview.h @@ -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