3 #include "fullscreenwindow.h"
4 #include "translucentbutton.h"
6 FullScreenWindow::FullScreenWindow(QWidget *child, QWidget *parent):
11 setAttribute(Qt::WA_Maemo5StackedWindow, true);
12 setAttribute(Qt::WA_Maemo5PortraitOrientation,
13 parent->testAttribute(Qt::WA_Maemo5PortraitOrientation));
14 setAttribute(Qt::WA_Maemo5LandscapeOrientation,
15 parent->testAttribute(Qt::WA_Maemo5LandscapeOrientation));
16 #endif // Q_WS_MAEMO_5
17 child->setParent(this);
18 setCentralWidget(child);
19 restoreButton = new TranslucentButton("view-fullscreen", this);
22 void FullScreenWindow::showFullScreen()
24 QWidget::showFullScreen();
25 restoreButton->flash();
28 void FullScreenWindow::MOUSE_ACTIVATE_EVENT(QMouseEvent *event)
30 if (fullScreenZone().contains(event->x(), event->y())) {
33 QMainWindow::MOUSE_ACTIVATE_EVENT(event);
36 QRect FullScreenWindow::fullScreenZone() const
38 return QRect(width() / 2 - 45, height() - 104, 95, 95);
41 void FullScreenWindow::resizeEvent(QResizeEvent *e)
43 restoreButton->setGeometry(fullScreenZone());
44 QMainWindow::resizeEvent(e);