3 #include "fullscreenwindow.h"
4 #include "translucentbutton.h"
7 FullScreenWindow::FullScreenWindow(QWidget *parent): BookWindow(parent)
11 setAttribute(Qt::WA_Maemo5StackedWindow, true);
12 setAttribute(Qt::WA_Maemo5NonComposited, true);
13 #endif // Q_WS_MAEMO_5
14 QFrame *frame = new QFrame(this);
15 QVBoxLayout *layout = new QVBoxLayout(frame);
17 frame->setLayout(layout);
18 setCentralWidget(frame);
19 restoreButton = new TranslucentButton("view-fullscreen", this);
22 void FullScreenWindow::showFullScreen()
25 setAttribute(Qt::WA_Maemo5PortraitOrientation, parentWidget()->
26 testAttribute(Qt::WA_Maemo5PortraitOrientation));
27 setAttribute(Qt::WA_Maemo5LandscapeOrientation, parentWidget()->
28 testAttribute(Qt::WA_Maemo5LandscapeOrientation));
29 #endif // Q_WS_MAEMO_5
30 QWidget::showFullScreen();
31 restoreButton->flash();
34 void FullScreenWindow::MOUSE_ACTIVATE_EVENT(QMouseEvent *event)
36 Trace t("FullScreenWindow::MOUSE_ACTIVATE_EVENT");
37 if (fullScreenZone().contains(event->x(), event->y())) {
40 restoreButton->flash(700);
42 QMainWindow::MOUSE_ACTIVATE_EVENT(event);
45 QRect FullScreenWindow::fullScreenZone() const
47 return QRect(width() / 2 - 45, height() - 104, 95, 95);
50 void FullScreenWindow::resizeEvent(QResizeEvent *e)
52 restoreButton->setGeometry(fullScreenZone());
53 QMainWindow::resizeEvent(e);