mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Fix issue #1237: White text on almost-white background
Signed-off-by: Michael Schuster <michael@schuster.ms>
This commit is contained in:
parent
c03bc8540c
commit
ccd20f0172
1 changed files with 10 additions and 0 deletions
|
@ -273,6 +273,11 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
rect.setHeight(texts.count() * subFm.height() + 2 * 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)
|
||||
auto oldBrush = painter->brush();
|
||||
auto oldPen = painter->pen();
|
||||
auto oldFont = painter->font();
|
||||
|
||||
painter->setBrush(color);
|
||||
painter->setPen(QColor(0xaa, 0xaa, 0xaa));
|
||||
painter->drawRoundedRect(QStyle::visualRect(option.direction, option.rect, rect),
|
||||
|
@ -290,6 +295,11 @@ void FolderStatusDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
textRect.translate(0, textRect.height());
|
||||
}
|
||||
|
||||
// restore previous state
|
||||
painter->setBrush(oldBrush);
|
||||
painter->setPen(oldPen);
|
||||
painter->setFont(oldFont);
|
||||
|
||||
h = rect.bottom() + margin;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue