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()) /
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();
}
#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);
- }
-}