summaryrefslogtreecommitdiffstats
path: root/hyperui/mainwindow.cpp
diff options
context:
space:
mode:
authorAdriano Rezende <adriano.rezende@openbossa.org>2009-10-30 11:40:07 -0300
committerAdriano Rezende <adriano.rezende@openbossa.org>2009-10-30 11:40:07 -0300
commit9eb35709ad9f8659211a077d1a01796d2d45e15a (patch)
tree8abece0e671a00163241a4b291d1d39db549bc0c /hyperui/mainwindow.cpp
parentd23f9795a0eeba4a55a06ca8568c7d5721c03480 (diff)
HyperUI: Added overlay to unlock screen
Diffstat (limited to 'hyperui/mainwindow.cpp')
-rw-r--r--hyperui/mainwindow.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/hyperui/mainwindow.cpp b/hyperui/mainwindow.cpp
index 4109833..80f6687 100644
--- a/hyperui/mainwindow.cpp
+++ b/hyperui/mainwindow.cpp
@@ -31,6 +31,7 @@
#include <QDateTime>
#include <QPainter>
+#include <QGraphicsRectItem>
#include "global.h"
#include "mainwindow.h"
@@ -59,9 +60,16 @@ MainWindow::MainWindow(QGraphicsItem *parent)
const int width = Resource::intValue("window/width");
const int height = Resource::intValue("window/height");
+ m_overlay = new QGraphicsRectItem(this);
+ m_overlay->setBrush(QColor(0, 0, 0, 100));
+ m_overlay->setRect(0, 0, width, height);
+ m_overlay->hide();
+
m_mainView = new PageView();
m_mainView->add(new MenuView());
m_preview = new DraggablePreview(m_mainView, QSize(width, height), this);
+ connect(m_preview, SIGNAL(draggableStarted()), SLOT(onDragModeIn()));
+ connect(m_preview, SIGNAL(minimizeStarted()), SLOT(onDragModeOut()));
connect(m_preview, SIGNAL(maximizeFinished()), SLOT(onMaximizeFinished()));
QGraphicsSimpleTextItem *phoneLabel =
@@ -96,8 +104,19 @@ MainWindow::MainWindow(QGraphicsItem *parent)
#endif
}
+void MainWindow::onDragModeIn()
+{
+ m_overlay->show();
+}
+
+void MainWindow::onDragModeOut()
+{
+ m_overlay->hide();
+}
+
void MainWindow::onMaximizeFinished()
{
+ m_overlay->hide();
m_clockWidget->hide();
}