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

Method MakeEditor

qrenderdoc/Windows/ShaderViewer.cpp:1696–1745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1694}
1695
1696ScintillaEdit *ShaderViewer::MakeEditor(const QString &name, const QString &text, int lang)
1697{
1698 ScintillaEdit *ret = new ScintillaEdit(this);
1699
1700 ret->setMarginLeft(4.0);
1701 ret->setMarginWidthN(1, 20.0);
1702 ret->setMarginWidthN(2, 16.0);
1703 ret->setObjectName(name);
1704
1705 ret->styleSetFont(STYLE_DEFAULT, Formatter::FixedFont().family().toUtf8().data());
1706 ret->styleSetSize(STYLE_DEFAULT, Formatter::FixedFont().pointSize());
1707
1708 // C# DarkGreen
1709 ret->indicSetFore(INDICATOR_REGHIGHLIGHT, SCINTILLA_COLOUR(0, 100, 0));
1710 ret->indicSetStyle(INDICATOR_REGHIGHLIGHT, INDIC_ROUNDBOX);
1711
1712 // set up find result highlight style
1713 ret->indicSetFore(INDICATOR_FINDRESULT, SCINTILLA_COLOUR(200, 200, 64));
1714 ret->indicSetStyle(INDICATOR_FINDRESULT, INDIC_FULLBOX);
1715 ret->indicSetAlpha(INDICATOR_FINDRESULT, 50);
1716 ret->indicSetOutlineAlpha(INDICATOR_FINDRESULT, 80);
1717
1718 QColor highlightColor = palette().color(QPalette::Highlight).toRgb();
1719
1720 ret->indicSetFore(
1721 INDICATOR_FINDALLHIGHLIGHT,
1722 SCINTILLA_COLOUR(highlightColor.red(), highlightColor.green(), highlightColor.blue()));
1723 ret->indicSetStyle(INDICATOR_FINDALLHIGHLIGHT, INDIC_FULLBOX);
1724 ret->indicSetAlpha(INDICATOR_FINDALLHIGHLIGHT, 120);
1725 ret->indicSetOutlineAlpha(INDICATOR_FINDALLHIGHLIGHT, 180);
1726
1727 // C# Highlight for bookmarks
1728 ret->markerSetBack(BOOKMARK_MARKER, SCINTILLA_COLOUR(51, 153, 255));
1729 ret->markerDefine(BOOKMARK_MARKER, SC_MARK_BOOKMARK);
1730
1731 ConfigureSyntax(ret, lang);
1732
1733 ret->setTabWidth(4);
1734
1735 ret->setScrollWidth(1);
1736 ret->setScrollWidthTracking(true);
1737
1738 ret->colourise(0, -1);
1739
1740 SetTextAndUpdateMargin0(ret, text);
1741
1742 ret->emptyUndoBuffer();
1743
1744 return ret;
1745}
1746
1747void ShaderViewer::SetTextAndUpdateMargin0(ScintillaEdit *sc, const QString &text)
1748{

Callers

nothing calls this directly

Calls 15

ConfigureSyntaxFunction · 0.85
setMarginLeftMethod · 0.80
setMarginWidthNMethod · 0.80
styleSetFontMethod · 0.80
toUtf8Method · 0.80
styleSetSizeMethod · 0.80
indicSetForeMethod · 0.80
indicSetStyleMethod · 0.80
indicSetAlphaMethod · 0.80
indicSetOutlineAlphaMethod · 0.80
markerSetBackMethod · 0.80
markerDefineMethod · 0.80

Tested by

no test coverage detected