diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/texteditor/basetexteditor.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index f957b23c4c..4f18085d29 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -3066,25 +3066,6 @@ void BaseTextEditorWidget::paintEvent(QPaintEvent *e) qreal lineX = 0; - if (d->m_visibleWrapColumn > 0) { - // Don't use QFontMetricsF::averageCharWidth here, due to it returning - // a fractional size even when this is not supported by the platform. - lineX = QFontMetricsF(font()).width(QLatin1Char('x')) * d->m_visibleWrapColumn + offset.x() + 4; - - if (lineX < viewportRect.width()) { - const QBrush background = ifdefedOutFormat.background(); - painter.fillRect(QRectF(lineX, er.top(), viewportRect.width() - lineX, er.height()), - background); - - const QColor col = (palette().base().color().value() > 128) ? Qt::black : Qt::white; - const QPen pen = painter.pen(); - painter.setPen(blendColors(background.isOpaque() ? background.color() : palette().base().color(), - col, 32)); - painter.drawLine(QPointF(lineX, er.top()), QPointF(lineX, er.bottom())); - painter.setPen(pen); - } - } - // Set a brush origin so that the WaveUnderline knows where the wave started painter.setBrushOrigin(offset); @@ -3226,6 +3207,26 @@ void BaseTextEditorWidget::paintEvent(QPaintEvent *e) } } + // draw wrap column after ifdefed out blocks + if (d->m_visibleWrapColumn > 0) { + // Don't use QFontMetricsF::averageCharWidth here, due to it returning + // a fractional size even when this is not supported by the platform. + lineX = QFontMetricsF(font()).width(QLatin1Char('x')) * d->m_visibleWrapColumn + offset.x() + 4; + + if (lineX < viewportRect.width()) { + const QBrush background = ifdefedOutFormat.background(); + painter.fillRect(QRectF(lineX, er.top(), viewportRect.width() - lineX, er.height()), + background); + + const QColor col = (palette().base().color().value() > 128) ? Qt::black : Qt::white; + const QPen pen = painter.pen(); + painter.setPen(blendColors(background.isOpaque() ? background.color() : palette().base().color(), + col, 32)); + painter.drawLine(QPointF(lineX, er.top()), QPointF(lineX, er.bottom())); + painter.setPen(pen); + } + } + // possible extra pass for the block selection find scope if (!d->m_findScopeStart.isNull() && d->m_findScopeVerticalBlockSelectionFirstColumn >= 0) { QTextBlock blockFS = block; |