Simplify FadeButton update (#5311)

This commit is contained in:
Hussam al-Homsi
2020-01-12 20:42:54 -05:00
committed by GitHub
parent ef99c53357
commit 63d11f763c
4 changed files with 1 additions and 109 deletions

View File

@@ -24,12 +24,10 @@
#include <QTimer>
#include <QApplication>
#include <QPainter>
#include "embed.h"
#include "FadeButton.h"
#include "update_event.h"
const float FadeDuration = 300;
@@ -71,7 +69,7 @@ void FadeButton::activate()
{
m_stateTimer.restart();
activeNotes++;
signalUpdate();
update();
}
@@ -94,14 +92,6 @@ void FadeButton::noteEnd()
m_releaseTimer.restart();
}
signalUpdate();
}
void FadeButton::customEvent(QEvent *)
{
update();
}
@@ -165,9 +155,3 @@ QColor FadeButton::fadeToColor(QColor startCol, QColor endCol, QTime timer, floa
return col;
}
void FadeButton::signalUpdate()
{
QApplication::postEvent(this, new updateEvent());
}