MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / setTheme

Method setTheme

MiniZincIDE/codeeditor.cpp:149–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void CodeEditor::setTheme(const Theme& _theme, bool _darkMode)
150{
151 darkMode = _darkMode;
152 theme = _theme;
153 highlighter->setTheme(theme, darkMode);
154 highlighter->rehighlight();
155
156 auto palette = this->palette();
157 palette.setColor(QPalette::Text, theme.textColor.get(darkMode));
158 palette.setColor(QPalette::Base, theme.backgroundColor.get(darkMode));
159 palette.setColor(QPalette::Highlight, theme.textHighlightColor.get(darkMode));
160 palette.setColor(QPalette::HighlightedText, theme.textColor.get(darkMode));
161 this->setPalette(palette);
162
163 viewport()->setStyleSheet(theme.styleSheet(darkMode));
164 cursorChange(); // Ensure extra selections are the correct colours
165}
166
167void CodeEditor::setIndentSize(int size)
168{

Calls 2

styleSheetMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected