Changeset View
Changeset View
Standalone View
Standalone View
src/ksieveui/editor/sievetextedit.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | |||||
117 | { | 117 | { | ||
118 | int digits = 1; | 118 | int digits = 1; | ||
119 | int max = qMax(1, blockCount()); | 119 | int max = qMax(1, blockCount()); | ||
120 | while (max >= 10) { | 120 | while (max >= 10) { | ||
121 | max /= 10; | 121 | max /= 10; | ||
122 | ++digits; | 122 | ++digits; | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | const int space = 3 + fontMetrics().width(QLatin1Char('9')) * digits; | 125 | const int space = 2 + fontMetrics().boundingRect(QLatin1Char('9')).width() * digits; | ||
126 | return space; | 126 | return space; | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | void SieveTextEdit::lineNumberAreaPaintEvent(QPaintEvent *event) | 129 | void SieveTextEdit::lineNumberAreaPaintEvent(QPaintEvent *event) | ||
130 | { | 130 | { | ||
131 | QPainter painter(d->m_sieveLineNumberArea); | 131 | QPainter painter(d->m_sieveLineNumberArea); | ||
132 | painter.fillRect(event->rect(), Qt::lightGray); | 132 | painter.fillRect(event->rect(), Qt::lightGray); | ||
133 | 133 | | |||
▲ Show 20 Lines • Show All 291 Lines • Show Last 20 Lines |