Fix background of folded-block popups

If the disabled code format in creator does not have a background
defined, we now use the page's default background.
This commit is contained in:
mae
2010-03-26 14:46:56 +01:00
parent 08e4c30eb1
commit f9fb0bc270

View File

@@ -2773,7 +2773,10 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
painter.save(); painter.save();
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
painter.translate(.5, .5); painter.translate(.5, .5);
painter.setBrush(d->m_ifdefedOutFormat.background()); QBrush brush = baseColor;
if (d->m_ifdefedOutFormat.hasProperty(QTextFormat::BackgroundBrush))
brush = d->m_ifdefedOutFormat.background();
painter.setBrush(brush);
painter.drawRoundedRect(QRectF(visibleCollapsedBlockOffset.x(), painter.drawRoundedRect(QRectF(visibleCollapsedBlockOffset.x(),
visibleCollapsedBlockOffset.y(), visibleCollapsedBlockOffset.y(),
maxWidth, blockHeight).adjusted(0, 0, 0, 0), 3, 3); maxWidth, blockHeight).adjusted(0, 0, 0, 0), 3, 3);