X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=adopterwindow.cpp;h=b60b61a16dbb54a88e12c8aec986aa7334e5cca5;hb=HEAD;hp=daafa295e305fc5367077a530ab2c3063febbff0;hpb=85c0b056445b61ed2b914b407b2c8839c999010b;p=dorian diff --git a/adopterwindow.cpp b/adopterwindow.cpp index daafa29..b60b61a 100644 --- a/adopterwindow.cpp +++ b/adopterwindow.cpp @@ -20,7 +20,7 @@ AdopterWindow::AdopterWindow(QWidget *parent): MainBase(parent), bookView(0), { TRACE; - // Monitor settings + // Monitor settings changes connect(Settings::instance(), SIGNAL(valueChanged(const QString &)), this, SLOT(onSettingsChanged(const QString &))); @@ -146,7 +146,7 @@ void AdopterWindow::resizeEvent(QResizeEvent *event) #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) // Restore previous reading position if (bookView) { - QTimer::singleShot(110, bookView, SLOT(restoreLastBookmark())); + bookView->scheduleRestoreLastBookmark(); } #endif // defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) } @@ -157,6 +157,7 @@ void AdopterWindow::closeEvent(QCloseEvent *event) if (bookView) { bookView->setLastBookmark(); } + hide(); MainBase::closeEvent(event); } @@ -171,7 +172,8 @@ void AdopterWindow::leaveEvent(QEvent *event) void AdopterWindow::keyPressEvent(QKeyEvent *event) { - TRACE; + Trace t("AdopterWindow::keyPressEvent"); + switch (event->key()) { case Qt::Key_PageDown: #ifdef Q_WS_MAEMO_5 @@ -214,6 +216,10 @@ void AdopterWindow::placeDecorations() qDebug() << "Has the book view"; int extraHeight = 0; +#if defined(Q_WS_X11) && !defined(Q_WS_MAEMO_5) + extraHeight += toolBarHeight(); +#endif + QRect geo = bookView->geometry(); qDebug() << "bookView:" << geo; @@ -223,8 +229,10 @@ void AdopterWindow::placeDecorations() previousButton->setGeometry(geo.x(), geo.y() + geo.height() - TranslucentButton::pixels + extraHeight, TranslucentButton::pixels, TranslucentButton::pixels); - nextButton->setGeometry(geo.x() + geo.width() - TranslucentButton::pixels, - geo.y(), TranslucentButton::pixels, TranslucentButton::pixels); + nextButton->setGeometry( + geo.x() + geo.width() - TranslucentButton::pixels, + geo.y() + extraHeight, TranslucentButton::pixels, + TranslucentButton::pixels); progress->flash(); previousButton->flash(); nextButton->flash();