From: Olivier Goffart Date: Wed, 17 Oct 2018 13:15:11 +0000 (+0200) Subject: Account Settings: fix progress being written in white when there are errors X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~467 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=84906648607c94f7ed6995adca4430997b9bd69c;p=nextcloud-desktop.git Account Settings: fix progress being written in white when there are errors --- diff --git a/src/gui/folderstatusdelegate.cpp b/src/gui/folderstatusdelegate.cpp index f130ba0d4..2bf59fe01 100644 --- a/src/gui/folderstatusdelegate.cpp +++ b/src/gui/folderstatusdelegate.cpp @@ -272,10 +272,7 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem & 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) - auto oldBrush = painter->brush(); - auto oldPen = painter->pen(); - auto oldFont = painter->font(); - + painter->save(); painter->setBrush(color); painter->setPen(QColor(0xaa, 0xaa, 0xaa)); 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())); textRect.translate(0, textRect.height()); } - // restore previous state - painter->setBrush(oldBrush); - painter->setPen(oldPen); - painter->setFont(oldFont); + painter->restore(); h = rect.bottom() + margin; };