diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2010-09-15 21:21:33 +0200 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@gmail.com> | 2010-10-08 22:45:02 +0200 |
commit | 6181e316ce8cfc1bef05c466a2470427ceb2deac (patch) | |
tree | 6f4affcedab1a8e63b29638810ee36851642c298 /src/notificationbar.cpp | |
parent | Merge branch 'm220' (diff) | |
download | rekonq-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.cpp')
-rw-r--r-- | src/notificationbar.cpp | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/src/notificationbar.cpp b/src/notificationbar.cpp index 94c5cba8..e3d9c6b0 100644 --- a/src/notificationbar.cpp +++ b/src/notificationbar.cpp @@ -22,47 +22,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * ============================================================ */ +// Self includes #include "notificationbar.h" +#include "notificationbar.moc" -#include <QApplication> -#include <QColor> -#include <QGraphicsEffect> -#include <QPainter> -#include <QPropertyAnimation> - - -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; +// Qt Includes -}; +#include <QLayout> +#include <QDebug> NotificationBar::NotificationBar(QWidget *parent) @@ -89,4 +56,10 @@ void NotificationBar::notifyUser(int animationDuration) } -#include "notificationbar.moc" +void NotificationBar::destroy() +{ + qDebug() << Q_FUNC_INFO << "deleting the bar" << this; + if (parentWidget() && parentWidget()->layout()) + parentWidget()->layout()->removeWidget(this); + deleteLater(); +} |