From 6181e316ce8cfc1bef05c466a2470427ceb2deac Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 15 Sep 2010 21:21:33 +0200 Subject: 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 --- src/notificationbar.cpp | 51 ++++++++++++------------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) (limited to 'src/notificationbar.cpp') 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 . * * ============================================================ */ +// Self includes #include "notificationbar.h" +#include "notificationbar.moc" -#include -#include -#include -#include -#include - - -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 +#include 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(); +} -- cgit v1.2.1