}
}
-void BookView::setLastBookmark()
+void BookView::setLastBookmark(bool fast)
{
TRACE;
if (mBook) {
int pos = frame->scrollPosition().y();
qDebug() << QString("At %1 (%2%, height %3)").
arg(pos).arg((qreal)pos / (qreal)height * 100).arg(height);
- mBook->setLastBookmark(contentIndex, (qreal)pos / (qreal)height);
+ mBook->setLastBookmark(contentIndex, (qreal)pos / (qreal)height, fast);
}
}
if (scroller) {
scrollerMonitor = startTimer(500);
}
+#elif defined(Q_OS_SYMBIAN)
+ // Do nothing
#else
- // Handle mouse presses on the scroll bar
+ // Handle mouse press on the scroll bar
QWebFrame *frame = page()->mainFrame();
if (frame->scrollBarGeometry(Qt::Vertical).contains(e->pos())) {
e->accept();
return;
}
-#endif // Q_WS_MAEMO_5
+#endif
e->ignore();
}
// Work around Qt bug that sometimes selects web view contents during swipe
switch (e->type()) {
case QEvent::MouseButtonPress:
- emit suppressedMouseButtonPress();
mousePressed = true;
break;
case QEvent::MouseButtonRelease:
+#ifndef Q_OS_SYMBIAN // Too heavy on Symbian
showProgress();
+#endif
mousePressed = false;
break;
case QEvent::MouseMove:
void BookView::showProgress()
{
+ TRACE;
if (mBook) {
int contentsHeight = page()->mainFrame()->contentsSize().height();
qreal pos = (qreal)(page()->mainFrame()->scrollPosition().y()) /
scrollerMonitor = -1;
}
}
-#endif
+#endif // Q_WS_MAEMO_5
+
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();
if (pos == frame->scrollPosition().y()) {
goNext();
} else {
- // setLastBookmark();
showProgress();
}
}