1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

FTW: Don't fire an animation if start- and endcolor are the same

This commit is contained in:
krepa098 2015-02-07 14:38:12 +01:00
parent d008b53c6f
commit a8acb05c52

View File

@ -121,9 +121,12 @@ void FileTransferWidget::acceptTransfer(const QString &filepath)
void FileTransferWidget::setColor(const QColor &c, bool whiteFont) void FileTransferWidget::setColor(const QColor &c, bool whiteFont)
{ {
colorAnimation->setStartValue(color); if(c != color)
colorAnimation->setEndValue(c); {
colorAnimation->start(); colorAnimation->setStartValue(color);
colorAnimation->setEndValue(c);
colorAnimation->start();
}
setProperty("fontColor", whiteFont ? "white" : "black"); setProperty("fontColor", whiteFont ? "white" : "black");