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
}
#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
}
}
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