Changeset View
Changeset View
Standalone View
Standalone View
examples/codeeditor/codeeditor.cpp
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Line(s) | 185 | { | |||
---|---|---|---|---|---|
187 | updateSidebarGeometry(); | 187 | updateSidebarGeometry(); | ||
188 | } | 188 | } | ||
189 | 189 | | |||
190 | void CodeEditor::setTheme(const KSyntaxHighlighting::Theme &theme) | 190 | void CodeEditor::setTheme(const KSyntaxHighlighting::Theme &theme) | ||
191 | { | 191 | { | ||
192 | auto pal = qApp->palette(); | 192 | auto pal = qApp->palette(); | ||
193 | if (theme.isValid()) { | 193 | if (theme.isValid()) { | ||
194 | pal.setColor(QPalette::Base, theme.editorColor(KSyntaxHighlighting::Theme::BackgroundColor)); | 194 | pal.setColor(QPalette::Base, theme.editorColor(KSyntaxHighlighting::Theme::BackgroundColor)); | ||
195 | pal.setColor(QPalette::Text, theme.textColor(KSyntaxHighlighting::Theme::Normal)); | | |||
196 | pal.setColor(QPalette::Highlight, theme.editorColor(KSyntaxHighlighting::Theme::TextSelection)); | 195 | pal.setColor(QPalette::Highlight, theme.editorColor(KSyntaxHighlighting::Theme::TextSelection)); | ||
197 | } | 196 | } | ||
198 | setPalette(pal); | 197 | setPalette(pal); | ||
199 | 198 | | |||
200 | m_highlighter->setTheme(theme); | 199 | m_highlighter->setTheme(theme); | ||
201 | m_highlighter->rehighlight(); | 200 | m_highlighter->rehighlight(); | ||
202 | highlightCurrentLine(); | 201 | highlightCurrentLine(); | ||
203 | } | 202 | } | ||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |