MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / areaWidth

Method areaWidth

src/texteditor.cpp:394–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394int TextEditorLineNumbers::areaWidth() const
395{
396 int digits = 1;
397 int max = std::max(1, m_editor.blockCount());
398
399 while (max >= 10) {
400 max /= 10;
401 ++digits;
402 }
403
404 digits = std::max(3, digits);
405
406 int space = 3 + fontMetrics().horizontalAdvance(QLatin1Char('9')) * digits + 3;
407
408 return space;
409}
410
411QColor TextEditorLineNumbers::textColor() const
412{

Callers 1

resizeEventMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected