X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=widgets%2Ffullscreenwindow.cpp;h=4382ebbe80e95ef0dc89282a25f0da474ad17f6d;hb=1e18404f04c033c518c7017cac0d9dc2ae8236b2;hp=682fbdb9cdeaa948e75976d20156ce449028c157;hpb=67043ec8b79ebd87b72d82d27397097371ec38b5;p=dorian diff --git a/widgets/fullscreenwindow.cpp b/widgets/fullscreenwindow.cpp index 682fbdb..4382ebb 100644 --- a/widgets/fullscreenwindow.cpp +++ b/widgets/fullscreenwindow.cpp @@ -4,19 +4,27 @@ #include "translucentbutton.h" #include "trace.h" -FullScreenWindow::FullScreenWindow(QWidget *parent): BookWindow(parent) +FullScreenWindow::FullScreenWindow(QWidget *parent): AdopterWindow(parent) { Q_ASSERT(parent); #ifdef Q_WS_MAEMO_5 setAttribute(Qt::WA_Maemo5StackedWindow, true); setAttribute(Qt::WA_Maemo5NonComposited, true); #endif // Q_WS_MAEMO_5 +#ifndef Q_OS_SYMBIAN + toolBar->hide(); +#endif QFrame *frame = new QFrame(this); QVBoxLayout *layout = new QVBoxLayout(frame); layout->setMargin(0); frame->setLayout(layout); setCentralWidget(frame); - restoreButton = new TranslucentButton("view-fullscreen", this); + restoreButton = new TranslucentButton("view-normal", this); + QRect screen = QApplication::desktop()->screenGeometry(); + restoreButton->setGeometry((screen.width() - TranslucentButton::pixels) / 2, + screen.height() - TranslucentButton::pixels - 9, + TranslucentButton::pixels, TranslucentButton::pixels); + connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore())); } void FullScreenWindow::showFullScreen() @@ -31,24 +39,11 @@ void FullScreenWindow::showFullScreen() restoreButton->flash(); } -void FullScreenWindow::MOUSE_ACTIVATE_EVENT(QMouseEvent *event) -{ - Trace t("FullScreenWindow::MOUSE_ACTIVATE_EVENT"); - if (fullScreenZone().contains(event->x(), event->y())) { - emit restore(); - } else { - restoreButton->flash(700); - } - QMainWindow::MOUSE_ACTIVATE_EVENT(event); -} - -QRect FullScreenWindow::fullScreenZone() const -{ - return QRect(width() / 2 - 45, height() - 104, 95, 95); -} - void FullScreenWindow::resizeEvent(QResizeEvent *e) { - restoreButton->setGeometry(fullScreenZone()); - QMainWindow::resizeEvent(e); + Q_UNUSED(e); + QRect screen = QApplication::desktop()->screenGeometry(); + restoreButton->setGeometry(screen.width() - TranslucentButton::pixels - 9, + screen.height() - TranslucentButton::pixels - 9, + TranslucentButton::pixels, TranslucentButton::pixels); }