X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=fullscreenwindow.cpp;h=c63f003a0edd04b6e050926ed594795dcb694f4a;hb=5b90676a3adb2b9df8504684093c165f684eac29;hp=ca8baba7f82256ef952b7e821dcfe8a07dd37d11;hpb=549e8d8b51f631005863aa7f4f3cb2683a901669;p=dorian diff --git a/fullscreenwindow.cpp b/fullscreenwindow.cpp index ca8baba..c63f003 100644 --- a/fullscreenwindow.cpp +++ b/fullscreenwindow.cpp @@ -9,8 +9,7 @@ static const int MARGIN = 9; -FullScreenWindow::FullScreenWindow(QWidget *parent): - AdopterWindow(parent), progress(0), previousButton(0), nextButton(0) +FullScreenWindow::FullScreenWindow(QWidget *parent): AdopterWindow(parent) { TRACE; Q_ASSERT(parent); @@ -18,9 +17,7 @@ FullScreenWindow::FullScreenWindow(QWidget *parent): setAttribute(Qt::WA_Maemo5StackedWindow, true); setAttribute(Qt::WA_Maemo5NonComposited, true); #endif // Q_WS_MAEMO_5 -#ifndef Q_OS_SYMBIAN - toolBar->hide(); -#endif + hideToolBar(); QFrame *frame = new QFrame(this); QVBoxLayout *layout = new QVBoxLayout(frame); layout->setMargin(0); @@ -36,16 +33,23 @@ FullScreenWindow::FullScreenWindow(QWidget *parent): connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore())); } -void FullScreenWindow::showFullScreen() +void FullScreenWindow::showEvent(QShowEvent *e) { - TRACE; - AdopterWindow::showFullScreen(); - restoreButton->flash(3000); + Trace t("FullScreenWindow::showEvent"); + AdopterWindow::showEvent(e); + placeChildren(); } void FullScreenWindow::resizeEvent(QResizeEvent *e) { - TRACE; + Trace t("FullScreenWindow::resizeEvent"); + AdopterWindow::resizeEvent(e); + placeChildren(); +} + +void FullScreenWindow::placeChildren() +{ + Trace t("FullScreenWindow::placeChildren"); QRect screen = QApplication::desktop()->screenGeometry(); int w = screen.width(); @@ -68,40 +72,5 @@ void FullScreenWindow::resizeEvent(QResizeEvent *e) h - TranslucentButton::pixels - MARGIN, TranslucentButton::pixels, TranslucentButton::pixels); - - if (hasChild(progress)) { - progress->setGeometry(0, h - progress->thickness(), - w, progress->thickness()); - } - if (hasChild(previousButton)) { - previousButton->setGeometry( - MARGIN, - h - TranslucentButton::pixels - MARGIN, - TranslucentButton::pixels, - TranslucentButton::pixels); - } - if (hasChild(nextButton)) { - nextButton->setGeometry( - w - TranslucentButton::pixels - MARGIN, - MARGIN, - TranslucentButton::pixels, - TranslucentButton::pixels); - } - restoreButton->flash(3000); - AdopterWindow::resizeEvent(e); -} - -void FullScreenWindow::takeChildren(BookView *view, - Progress *prog, - TranslucentButton *previous, - TranslucentButton *next) -{ - TRACE; - progress = prog; - previousButton = previous; - nextButton = next; - QList otherChildren; - otherChildren << progress << previousButton << nextButton; - AdopterWindow::takeChildren(view, otherChildren); }