void BookView::leaveEvent(QEvent *e)
{
TRACE;
- // Save current position, to be restored later
+ // Save current position, to be restored later, in MainWindow::resizeEvent()
setLastBookmark();
QWebView::leaveEvent(e);
}
-void BookView::resizeEvent(QEvent *e)
-{
- TRACE;
- // Restore position saved at Leave event. This seems to be required,
- // after temporarily switching from portrait to landscape and back
- restoreLastBookmark();
- QWebView::enterEvent(e);
-}
-
#endif // Q_WS_MAEMO_5
void BookView::goToPosition(qreal position)
public:
explicit BookView(QWidget *parent = 0);
+
+ /** Set current book. */
void setBook(Book *book);
+
+ /** Get current book. */
Book *book();
+
+ /** Go to the position decribed by "bookmark". */
void goToBookmark(const Book::Bookmark &bookmark);
+
+ /** Add bookmark to book at the current position. */
void addBookmark(const QString ¬e);
+
+ /** Save current reading position into book. */
void setLastBookmark();
- void restoreLastBookmark();
+
+ /** Go to given part + part fragment URL. */
void goToPart(int part, const QString &fragment);
+
+ /** Go to given fragment URL in current part. */
void goToFragment(const QString &fragment);
/** If grab is true, volume keys will generate act as page up/down. */
/** Restore saved position after URL loading finished. */
void restoreAfterLoad();
+ /** Restore book's last reading position. */
+ void restoreLastBookmark();
+
protected slots:
#ifdef Q_OS_SYMBIAN
/** Observe media keys. */
void timerEvent(QTimerEvent *e);
#ifdef Q_WS_MAEMO_5
void leaveEvent(QEvent *e);
- void resizeEvent(QEvent *e);
#endif // Q_WS_MAEMO_5
/** Load given part. */
{
TRACE;
Q_UNUSED(e);
+ restoreButton->raise();
QRect screen = QApplication::desktop()->screenGeometry();
restoreButton->setGeometry(screen.width() - TranslucentButton::pixels - 9,
screen.height() - TranslucentButton::pixels - 9,
toolBar->height(), TranslucentButton::pixels, TranslucentButton::pixels);
#endif // Q_WS_MAEMO_5
qDebug() << "previousButton geometry" << previousButton->geometry();
+
+#ifdef Q_WS_MAEMO_5
+ // This is needed on Maemo, in order not to lose current reading position
+ // after orientation change
+ QTimer::singleShot(250, view, SLOT(restoreLastBookmark()));
+#endif
previousButton->flash();
nextButton->flash();
QMainWindow::resizeEvent(e);
dorian (0.3.5-1) unstable; urgency=low
- *
+ * Fix chapter navigation on Maemo
-- Akos Polster <akos@pipacs.com> Sun, 7 Nov 2010 02:00:00 +0100