3 #include "fullscreenwindow.h"
4 #include "translucentbutton.h"
10 static const int MARGIN = 9;
12 FullScreenWindow::FullScreenWindow(QWidget *parent): AdopterWindow(parent)
17 setAttribute(Qt::WA_Maemo5StackedWindow, true);
18 setAttribute(Qt::WA_Maemo5NonComposited, true);
19 #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(
28 screen.width() - TranslucentButton::pixels - MARGIN,
29 screen.height() - TranslucentButton::pixels - MARGIN,
30 TranslucentButton::pixels,
31 TranslucentButton::pixels);
32 connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore()));
35 void FullScreenWindow::showEvent(QShowEvent *e)
37 Trace t("FullScreenWindow::showEvent");
38 AdopterWindow::showEvent(e);
42 void FullScreenWindow::resizeEvent(QResizeEvent *e)
44 Trace t("FullScreenWindow::resizeEvent");
45 AdopterWindow::resizeEvent(e);
49 void FullScreenWindow::placeChildren()
51 Trace t("FullScreenWindow::placeChildren");
53 QRect screen = QApplication::desktop()->screenGeometry();
54 int w = screen.width();
55 int h = screen.height();
58 // Hack: FullScreenWindow can lose orientation on Maemo...
59 QString orientation = Settings::instance()->value("orientation",
60 Platform::instance()->defaultOrientation()).toString();
61 if (((orientation == "portrait") && (w > h)) ||
62 ((orientation == "landscape") && (w < h))) {
67 #endif // Q_WS_MAEMO_5
69 restoreButton->setGeometry(
70 w - TranslucentButton::pixels - MARGIN,
71 h - TranslucentButton::pixels - MARGIN,
72 TranslucentButton::pixels,
73 TranslucentButton::pixels);
74 restoreButton->flash(3000);