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
23 QFrame *frame = new QFrame(this);
24 QVBoxLayout *layout = new QVBoxLayout(frame);
26 frame->setLayout(layout);
27 setCentralWidget(frame);
28 restoreButton = new TranslucentButton("view-normal", this);
29 QRect screen = QApplication::desktop()->screenGeometry();
30 restoreButton->setGeometry(
31 screen.width() - TranslucentButton::pixels - MARGIN,
32 screen.height() - TranslucentButton::pixels - MARGIN,
33 TranslucentButton::pixels,
34 TranslucentButton::pixels);
35 connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore()));
38 void FullScreenWindow::showEvent(QShowEvent *e)
40 Trace t("FullScreenWindow::showEvent");
41 AdopterWindow::showEvent(e);
45 void FullScreenWindow::resizeEvent(QResizeEvent *e)
47 Trace t("FullScreenWindow::resizeEvent");
48 AdopterWindow::resizeEvent(e);
52 void FullScreenWindow::placeChildren()
54 Trace t("FullScreenWindow::placeChildren");
56 QRect screen = QApplication::desktop()->screenGeometry();
57 int w = screen.width();
58 int h = screen.height();
61 // Hack: FullScreenWindow can lose orientation on Maemo...
62 QString orientation = Settings::instance()->value("orientation",
63 Platform::instance()->defaultOrientation()).toString();
64 if (((orientation == "portrait") && (w > h)) ||
65 ((orientation == "landscape") && (w < h))) {
70 #endif // Q_WS_MAEMO_5
72 restoreButton->setGeometry(
73 w - TranslucentButton::pixels - MARGIN,
74 h - TranslucentButton::pixels - MARGIN,
75 TranslucentButton::pixels,
76 TranslucentButton::pixels);
77 restoreButton->flash(3000);