Account Settings: fix progress being written in white when there are errors

This commit is contained in:
Olivier Goffart 2018-10-17 15:15:11 +02:00 committed by Kevin Ottens
parent dd34cbc751
commit 8490664860
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2

View file

@ -272,10 +272,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
rect.setRight(option.rect.right() - margin); rect.setRight(option.rect.right() - margin);
// save previous state to not mess up colours with the background (fixes issue: https://github.com/nextcloud/desktop/issues/1237) // save previous state to not mess up colours with the background (fixes issue: https://github.com/nextcloud/desktop/issues/1237)
auto oldBrush = painter->brush(); painter->save();
auto oldPen = painter->pen();
auto oldFont = painter->font();
painter->setBrush(color); painter->setBrush(color);
painter->setPen(QColor(0xaa, 0xaa, 0xaa)); painter->setPen(QColor(0xaa, 0xaa, 0xaa));
painter->drawRoundedRect(QStyle::visualRect(option.direction, option.rect, rect), painter->drawRoundedRect(QStyle::visualRect(option.direction, option.rect, rect),
@ -292,11 +289,8 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
subFm.elidedText(eText, Qt::ElideLeft, textRect.width())); subFm.elidedText(eText, Qt::ElideLeft, textRect.width()));
textRect.translate(0, textRect.height()); textRect.translate(0, textRect.height());
} }
// restore previous state // restore previous state
painter->setBrush(oldBrush); painter->restore();
painter->setPen(oldPen);
painter->setFont(oldFont);
h = rect.bottom() + margin; h = rect.bottom() + margin;
}; };