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
21 QFrame *frame = new QFrame(this);
22 QVBoxLayout *layout = new QVBoxLayout(frame);
24 frame->setLayout(layout);
25 setCentralWidget(frame);
26 restoreButton = new TranslucentButton("view-normal", this);
27 QRect screen = QApplication::desktop()->screenGeometry();
28 restoreButton->setGeometry(
29 screen.width() - TranslucentButton::pixels - MARGIN,
30 screen.height() - TranslucentButton::pixels - MARGIN,
31 TranslucentButton::pixels,
32 TranslucentButton::pixels);
33 connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore()));
36 void FullScreenWindow::showEvent(QShowEvent *e)
38 Trace t("FullScreenWindow::showEvent");
39 AdopterWindow::showEvent(e);
43 void FullScreenWindow::resizeEvent(QResizeEvent *e)
45 Trace t("FullScreenWindow::resizeEvent");
46 AdopterWindow::resizeEvent(e);
50 void FullScreenWindow::placeChildren()
52 Trace t("FullScreenWindow::placeChildren");
54 QRect screen = QApplication::desktop()->screenGeometry();
55 int w = screen.width();
56 int h = screen.height();
59 // Hack: FullScreenWindow can lose orientation on Maemo...
60 QString orientation = Settings::instance()->value("orientation",
61 Platform::instance()->defaultOrientation()).toString();
62 if (((orientation == "portrait") && (w > h)) ||
63 ((orientation == "landscape") && (w < h))) {
68 #endif // Q_WS_MAEMO_5
70 restoreButton->setGeometry(
71 w - TranslucentButton::pixels - MARGIN,
72 h - TranslucentButton::pixels - MARGIN,
73 TranslucentButton::pixels,
74 TranslucentButton::pixels);
75 restoreButton->flash(3000);