Merge pull request #71036 from Calinou/shader-editor-tweak-disabled-branch-color

Tweak text color for disabled preprocessor branches in the shader editor
This commit is contained in:
Rémi Verschelde 2023-01-08 22:39:09 +01:00
commit 30b3434daa
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -301,7 +301,9 @@ void ShaderTextEditor::_load_theme_settings() {
syntax_highlighter->clear_color_regions(); syntax_highlighter->clear_color_regions();
syntax_highlighter->add_color_region("/*", "*/", comment_color, false); syntax_highlighter->add_color_region("/*", "*/", comment_color, false);
syntax_highlighter->add_color_region("//", "", comment_color, true); syntax_highlighter->add_color_region("//", "", comment_color, true);
syntax_highlighter->set_disabled_branch_color(comment_color);
// Disabled preprocessor branches use translucent text color to be easier to distinguish from comments.
syntax_highlighter->set_disabled_branch_color(Color(EDITOR_GET("text_editor/theme/highlighting/text_color")) * Color(1, 1, 1, 0.5));
te->clear_comment_delimiters(); te->clear_comment_delimiters();
te->add_comment_delimiter("/*", "*/", false); te->add_comment_delimiter("/*", "*/", false);