MCPcopy Create free account
hub / github.com/baldurk/renderdoc / SetTextAndUpdateMargin0

Method SetTextAndUpdateMargin0

qrenderdoc/Windows/ShaderViewer.cpp:1747–1760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1745}
1746
1747void ShaderViewer::SetTextAndUpdateMargin0(ScintillaEdit *sc, const QString &text)
1748{
1749 sc->setText(text.toUtf8().data());
1750
1751 int numLines = sc->lineCount();
1752
1753 // don't make the margin too narrow, it looks strange even if there are only 5 lines in a file
1754 // we also add on an extra character for padding (with the *10)
1755 numLines = qMax(1000, numLines * 10);
1756
1757 sptr_t width = sc->textWidth(SC_MARGIN_RTEXT, QString::number(numLines).toUtf8().data());
1758
1759 sc->setMarginWidthN(0, int(width));
1760}
1761
1762void ShaderViewer::readonly_keyPressed(QKeyEvent *event)
1763{

Callers

nothing calls this directly

Calls 6

toUtf8Method · 0.80
lineCountMethod · 0.80
textWidthMethod · 0.80
setMarginWidthNMethod · 0.80
setTextMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected