summaryrefslogtreecommitdiffstats
path: root/hyperui
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
parentd23f9795a0eeba4a55a06ca8568c7d5721c03480 (diff)
HyperUI: Added overlay to unlock screen
Diffstat (limited to 'hyperui')
-rw-r--r--hyperui/mainwindow.cpp19
-rw-r--r--hyperui/mainwindow.h4
2 files changed, 23 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();
}
diff --git a/hyperui/mainwindow.h b/hyperui/mainwindow.h
index e3b3e69..f8c7756 100644
--- a/hyperui/mainwindow.h
+++ b/hyperui/mainwindow.h
@@ -40,6 +40,7 @@ class DraggablePreview;
QT_BEGIN_NAMESPACE
class QPainter;
+class QGraphicsRectItem;
class QStyleOptionGraphicsItem;
QT_END_NAMESPACE
@@ -55,6 +56,8 @@ public:
QWidget *widget = 0);
private slots:
+ void onDragModeIn();
+ void onDragModeOut();
void onMaximizeFinished();
#ifdef Q_OS_SYMBIAN
@@ -68,6 +71,7 @@ private:
PageView *m_mainView;
ClockWidget *m_clockWidget;
DraggablePreview *m_preview;
+ QGraphicsRectItem *m_overlay;
};
#endif