From 09e8062a9a76194a83919cb4ad8ff95f7feb8257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Wed, 13 Jan 2016 22:02:15 +0100 Subject: [PATCH] removed unneeded animation in NotificationsLabelWidget --- YACReader/notifications_label_widget.cpp | 21 ++++----------------- YACReader/notifications_label_widget.h | 2 -- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/YACReader/notifications_label_widget.cpp b/YACReader/notifications_label_widget.cpp index 08788725..a1767dfd 100644 --- a/YACReader/notifications_label_widget.cpp +++ b/YACReader/notifications_label_widget.cpp @@ -11,25 +11,15 @@ NotificationsLabelWidget::NotificationsLabelWidget(QWidget * parent) setAttribute(Qt::WA_LayoutUsesWidgetRect,true); effect = new QGraphicsOpacityEffect(this); - effect->setOpacity(1.0); - - effect2= new QGraphicsOpacityEffect(this); - effect->setOpacity(1.0); + effect->setOpacity(1.0); anim = new QPropertyAnimation(effect,"opacity"); anim->setDuration(500); - anim->setStartValue(1.0); - anim->setEndValue(0.0); + anim->setStartValue(1.0); + anim->setEndValue(0.0); anim->setEasingCurve(QEasingCurve::InExpo); - anim2 = new QPropertyAnimation(effect2,"opacity"); - anim2->setDuration(500); - anim2->setStartValue(1.0); - anim2->setEndValue(0.0); - anim2->setEasingCurve(QEasingCurve::InExpo); - anim2->start(); - - connect(anim,SIGNAL(finished()),this,SLOT(hide())); + connect(anim,SIGNAL(finished()),this,SLOT(hide())); textLabel = new QLabel(this); textLabel->setAlignment(Qt::AlignVCenter|Qt::AlignHCenter); @@ -41,7 +31,6 @@ NotificationsLabelWidget::NotificationsLabelWidget(QWidget * parent) //TODO check if the effects still be broken in OSX yet #ifndef Q_OS_MAC this->setGraphicsEffect(effect); - textLabel->setGraphicsEffect(effect2); #endif layout->addWidget(textLabel); @@ -66,9 +55,7 @@ void NotificationsLabelWidget::flash() { updatePosition(); anim->stop(); - anim2->stop(); anim->start(); - anim2->start(); setVisible(true); } diff --git a/YACReader/notifications_label_widget.h b/YACReader/notifications_label_widget.h index 9c59e3f4..12ded1ac 100644 --- a/YACReader/notifications_label_widget.h +++ b/YACReader/notifications_label_widget.h @@ -13,9 +13,7 @@ Q_OBJECT private: QLabel * textLabel; QPropertyAnimation * anim; - QPropertyAnimation * anim2; QGraphicsOpacityEffect * effect; - QGraphicsOpacityEffect * effect2; protected: void paintEvent(QPaintEvent *);