summaryrefslogtreecommitdiff
path: root/modules/gdscript/editor
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-10-02 09:13:14 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-10-02 09:36:47 +0200
commit621bafb9485f3ac69ffbc3509a433623a68f8c81 (patch)
treef872b13dd771d43b3ca43c9017fb79af5fb2ec67 /modules/gdscript/editor
parent09bf1b35c0310617924fc4eaca32d5b91460d492 (diff)
Tweak the default function definition color when using a dark theme
This decreases its saturation to make it less visually jarring. The code was also refactored for clarity and to avoid repetition.
Diffstat (limited to 'modules/gdscript/editor')
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index ee7313957c..4d6279074c 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -364,20 +364,28 @@ void GDScriptSyntaxHighlighter::_update_cache() {
number_color = text_editor->get_color("number_color");
member_color = text_editor->get_color("member_variable_color");
- EditorSettings *settings = EditorSettings::get_singleton();
- String text_editor_color_theme = settings->get("text_editor/theme/color_theme");
-
- bool default_theme = text_editor_color_theme == "Default";
- bool dark_theme = settings->is_dark_theme();
-
- function_definition_color = default_theme ? Color(0.0, 0.88, 1.0) : dark_theme ? Color(0.0, 0.88, 1.0) : Color(0.0, 0.65, 0.73);
- node_path_color = default_theme ? Color(0.39, 0.76, 0.35) : dark_theme ? Color(0.39, 0.76, 0.35) : Color(0.32, 0.55, 0.29);
+ const String text_editor_color_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme");
+ const bool default_theme = text_editor_color_theme == "Default";
+
+ if (default_theme || EditorSettings::get_singleton()->is_dark_theme()) {
+ function_definition_color = Color(0.4, 0.9, 1.0);
+ node_path_color = Color(0.39, 0.76, 0.35);
+ } else {
+ function_definition_color = Color(0.0, 0.65, 0.73);
+ node_path_color = Color(0.32, 0.55, 0.29);
+ }
EDITOR_DEF("text_editor/highlighting/gdscript/function_definition_color", function_definition_color);
EDITOR_DEF("text_editor/highlighting/gdscript/node_path_color", node_path_color);
if (text_editor_color_theme == "Adaptive" || default_theme) {
- settings->set_initial_value("text_editor/highlighting/gdscript/function_definition_color", function_definition_color, true);
- settings->set_initial_value("text_editor/highlighting/gdscript/node_path_color", node_path_color, true);
+ EditorSettings::get_singleton()->set_initial_value(
+ "text_editor/highlighting/gdscript/function_definition_color",
+ function_definition_color,
+ true);
+ EditorSettings::get_singleton()->set_initial_value(
+ "text_editor/highlighting/gdscript/node_path_color",
+ node_path_color,
+ true);
}
function_definition_color = EDITOR_GET("text_editor/highlighting/gdscript/function_definition_color");