TextEditor: Fine tune painting of the light bulb

* Paint it a bit bigger
* Center vertically in line

Change-Id: I5ba751e9b1e21591965bbf7a9ce020ee7b2b9c66
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2016-02-08 11:19:24 +01:00
parent bab230313d
commit 9a248913c8

View File

@@ -77,12 +77,13 @@ void RefactorOverlay::paintMarker(const RefactorMarker& marker, QPainter *painte
if (icon.isNull()) if (icon.isNull())
icon = m_icon; 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()); cursorRect.height());
const QSize actualIconSize = icon.actualSize(proposedIconSize); const QSize actualIconSize = icon.actualSize(proposedIconSize);
const int y = cursorRect.top() + ((cursorRect.height() - actualIconSize.height()) / 2);
const int x = cursorRect.right(); 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); icon.paint(painter, marker.rect);
m_maxWidth = qMax(m_maxWidth, x + actualIconSize.width() - int(offset.x())); m_maxWidth = qMax(m_maxWidth, x + actualIconSize.width() - int(offset.x()));