From f9fb0bc270b3f087cdf824c29e5a5ee923a85d3a Mon Sep 17 00:00:00 2001 From: mae <qt-info@nokia.com> Date: Fri, 26 Mar 2010 14:46:56 +0100 Subject: [PATCH] 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. --- src/plugins/texteditor/basetexteditor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index a3537d03af7..7b08961bb96 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2773,7 +2773,10 @@ void BaseTextEditor::paintEvent(QPaintEvent *e) painter.save(); painter.setRenderHint(QPainter::Antialiasing, true); 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(), visibleCollapsedBlockOffset.y(), maxWidth, blockHeight).adjusted(0, 0, 0, 0), 3, 3); -- GitLab