summaryrefslogtreecommitdiff
path: root/src/notificationbar.h
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2010-09-15 21:21:33 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2010-10-08 22:45:02 +0200
commit6181e316ce8cfc1bef05c466a2470427ceb2deac (patch)
tree6f4affcedab1a8e63b29638810ee36851642c298 /src/notificationbar.h
parentMerge branch 'm220' (diff)
downloadrekonq-6181e316ce8cfc1bef05c466a2470427ceb2deac.tar.xz
Prompt user before restoring session after a crash.
Shows the about:closedTabs page in the background. Task: https://bugs.kde.org/show_bug.cgi?id=249228
Diffstat (limited to 'src/notificationbar.h')
-rw-r--r--src/notificationbar.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/notificationbar.h b/src/notificationbar.h
index 858fac80..74372f0a 100644
--- a/src/notificationbar.h
+++ b/src/notificationbar.h
@@ -27,14 +27,52 @@
#define NOTIFICATIONBAR_H
// Qt Includes
+#include <QApplication>
+#include <QColor>
+#include <QGraphicsEffect>
+#include <QPainter>
+#include <QPropertyAnimation>
#include <QWidget>
// Forward Declarations
class QPropertyAnimation;
-class BlinkEffect;
+
+class BlinkEffect : public QGraphicsEffect
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
+
+public:
+ BlinkEffect(QObject *parent = 0)
+ : QGraphicsEffect(parent)
+ , m_opacity(0)
+ , m_backgroundColor(QApplication::palette().highlight().color().lighter())
+ {}
+
+ qreal opacity() const { return m_opacity; }
+ void setOpacity(qreal opacity)
+ {
+ m_opacity = opacity;
+ update();
+ }
+
+protected:
+ void draw(QPainter *painter)
+ {
+ painter->drawPixmap(QPoint(0,0), sourcePixmap());
+ painter->setOpacity(m_opacity);
+ painter->fillRect(boundingRect(), m_backgroundColor);
+ }
+
+private:
+ double m_opacity;
+ QColor m_backgroundColor;
+
+};
class NotificationBar : public QWidget
{
+ Q_OBJECT
public:
explicit NotificationBar(QWidget *parent = 0);
~NotificationBar();
@@ -44,6 +82,8 @@ public:
private:
BlinkEffect *m_blinkEffect;
QPropertyAnimation *m_opacityAnimation;
+protected slots:
+ void destroy();
};