diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-10-11 12:23:07 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-10-11 12:23:07 +0200 |
commit | ab7a1d8e856894a0074178aee111b4043738d439 (patch) | |
tree | 732390d3b542a53a1c850bb262b077d157b54237 /src/notificationbar.h | |
parent | No need to check progress if load is finished. (diff) | |
parent | ListItem: add auto test for multiple word highlighting. (diff) | |
download | rekonq-ab7a1d8e856894a0074178aee111b4043738d439.tar.xz |
Merge branch 'm213'
Diffstat (limited to 'src/notificationbar.h')
-rw-r--r-- | src/notificationbar.h | 42 |
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(); }; |