summaryrefslogtreecommitdiff
path: root/src/notificationbar.h
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-10-11 12:23:07 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-10-11 12:23:07 +0200
commitab7a1d8e856894a0074178aee111b4043738d439 (patch)
tree732390d3b542a53a1c850bb262b077d157b54237 /src/notificationbar.h
parentNo need to check progress if load is finished. (diff)
parentListItem: add auto test for multiple word highlighting. (diff)
downloadrekonq-ab7a1d8e856894a0074178aee111b4043738d439.tar.xz
Merge branch 'm213'
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();
};