3 #include "fullscreenwindow.h"
4 #include "translucentbutton.h"
9 FullScreenWindow::FullScreenWindow(QWidget *parent): AdopterWindow(parent)
14 setAttribute(Qt::WA_Maemo5StackedWindow, true);
15 setAttribute(Qt::WA_Maemo5NonComposited, true);
16 #endif // Q_WS_MAEMO_5
20 QFrame *frame = new QFrame(this);
21 QVBoxLayout *layout = new QVBoxLayout(frame);
23 frame->setLayout(layout);
24 setCentralWidget(frame);
25 restoreButton = new TranslucentButton("view-normal", this);
26 QRect screen = QApplication::desktop()->screenGeometry();
27 restoreButton->setGeometry(screen.width() - TranslucentButton::pixels - 9,
28 screen.height() - TranslucentButton::pixels - 9,
29 TranslucentButton::pixels, TranslucentButton::pixels);
30 connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore()));
33 void FullScreenWindow::showFullScreen()
36 AdopterWindow::showFullScreen();
37 restoreButton->flash(3000);
40 void FullScreenWindow::resizeEvent(QResizeEvent *e)
44 QRect screen = QApplication::desktop()->screenGeometry();
45 int w = screen.width();
46 int h = screen.height();
49 // Hack: FullScreenWindow can lose orientation on Maemo...
50 QString orientation = Settings::instance()->value("orientation",
51 Platform::instance()->defaultOrientation()).toString();
52 if (((orientation == "portrait") && (w > h)) ||
53 ((orientation == "landscape") && (w < h))) {
58 #endif // Q_WS_MAEMO_5
60 restoreButton->setGeometry(w - TranslucentButton::pixels - 9,
61 h - TranslucentButton::pixels - 9, TranslucentButton::pixels,
62 TranslucentButton::pixels);
63 restoreButton->flash(3000);
64 AdopterWindow::resizeEvent(e);