From 9a248913c8db3892462ad68d3ff7cc52d1b88ce5 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 8 Feb 2016 11:19:24 +0100 Subject: [PATCH] TextEditor: Fine tune painting of the light bulb * Paint it a bit bigger * Center vertically in line Change-Id: I5ba751e9b1e21591965bbf7a9ce020ee7b2b9c66 Reviewed-by: David Schulz --- src/plugins/texteditor/refactoroverlay.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/texteditor/refactoroverlay.cpp b/src/plugins/texteditor/refactoroverlay.cpp index 7af475b8d8d..1a68097cf06 100644 --- a/src/plugins/texteditor/refactoroverlay.cpp +++ b/src/plugins/texteditor/refactoroverlay.cpp @@ -77,12 +77,13 @@ void RefactorOverlay::paintMarker(const RefactorMarker& marker, QPainter *painte if (icon.isNull()) icon = m_icon; - const QSize proposedIconSize = QSize(m_editor->fontMetrics().width(QLatin1Char(' ')) + 2, + const QSize proposedIconSize = QSize(m_editor->fontMetrics().width(QLatin1Char(' ')) + 3, cursorRect.height()); const QSize actualIconSize = icon.actualSize(proposedIconSize); + const int y = cursorRect.top() + ((cursorRect.height() - actualIconSize.height()) / 2); const int x = cursorRect.right(); - marker.rect = QRect(x, cursorRect.top(), actualIconSize.width(), actualIconSize.height()); + marker.rect = QRect(x, y, actualIconSize.width(), actualIconSize.height()); icon.paint(painter, marker.rect); m_maxWidth = qMax(m_maxWidth, x + actualIconSize.width() - int(offset.x()));