summaryrefslogtreecommitdiff
path: root/editor/editor_themes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_themes.cpp')
-rw-r--r--editor/editor_themes.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index bc42a3f23b..c930824b98 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -238,16 +238,17 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const float default_contrast = 0.25;
//Theme settings
- Color accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#699ce8"));
- Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#323b4f"));
- float contrast = EDITOR_DEF("interface/theme/contrast", default_contrast);
+ Color accent_color = EDITOR_GET("interface/theme/accent_color");
+ Color base_color = EDITOR_GET("interface/theme/base_color");
+ float contrast = EDITOR_GET("interface/theme/contrast");
+ float relationship_line_opacity = EDITOR_GET("interface/theme/relationship_line_opacity");
- String preset = EDITOR_DEF("interface/theme/preset", "Default");
+ String preset = EDITOR_GET("interface/theme/preset");
- bool highlight_tabs = EDITOR_DEF("interface/theme/highlight_tabs", false);
- int border_size = EDITOR_DEF("interface/theme/border_size", 1);
+ bool highlight_tabs = EDITOR_GET("interface/theme/highlight_tabs");
+ int border_size = EDITOR_GET("interface/theme/border_size");
- bool use_gn_headers = EDITOR_DEF("interface/theme/use_graph_node_headers", false);
+ bool use_gn_headers = EDITOR_GET("interface/theme/use_graph_node_headers");
Color preset_accent_color;
Color preset_base_color;
@@ -260,9 +261,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
preset_base_color = Color::html("#323b4f");
preset_contrast = default_contrast;
} else if (preset == "Custom") {
- accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#699ce8"));
- base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#323b4f"));
- contrast = EDITOR_DEF("interface/theme/contrast", default_contrast);
+ accent_color = EDITOR_GET("interface/theme/accent_color");
+ base_color = EDITOR_GET("interface/theme/base_color");
+ contrast = EDITOR_GET("interface/theme/contrast");
} else if (preset == "Alien") {
preset_accent_color = Color::html("#1bfe99");
preset_base_color = Color::html("#2f373f");
@@ -328,7 +329,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color font_color = mono_color.linear_interpolate(base_color, 0.25);
const Color font_color_hl = mono_color.linear_interpolate(base_color, 0.15);
const Color font_color_disabled = Color(mono_color.r, mono_color.g, mono_color.b, 0.3);
- const Color font_color_selection = Color::html("#7d7d7d");
+ const Color font_color_selection = accent_color * Color(1, 1, 1, 0.4);
const Color color_disabled = mono_color.inverted().linear_interpolate(base_color, 0.7);
const Color color_disabled_bg = mono_color.inverted().linear_interpolate(base_color, 0.9);
@@ -368,7 +369,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("error_color", "Editor", error_color);
theme->set_color("property_color", "Editor", property_color);
- const int thumb_size = EDITOR_DEF("filesystem/file_dialog/thumbnail_size", 64);
+ const int thumb_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size");
theme->set_constant("scale", "Editor", EDSCALE);
theme->set_constant("thumb_size", "Editor", thumb_size);
theme->set_constant("dark_theme", "Editor", dark_theme);
@@ -660,6 +661,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("bg", "Tree", style_tree_bg);
const Color guide_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.05);
+ Color relationship_line_color = Color(mono_color.r, mono_color.g, mono_color.b, relationship_line_opacity);
// Tree
theme->set_icon("checked", "Tree", theme->get_icon("GuiChecked", "EditorIcons"));
theme->set_icon("unchecked", "Tree", theme->get_icon("GuiUnchecked", "EditorIcons"));
@@ -678,13 +680,15 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_color_selected", "Tree", mono_color);
theme->set_color("title_button_color", "Tree", font_color);
theme->set_color("guide_color", "Tree", guide_color);
+ theme->set_color("relationship_line_color", "Tree", relationship_line_color);
theme->set_color("drop_position_color", "Tree", accent_color);
theme->set_constant("vseparation", "Tree", (extra_spacing + default_margin_size) * EDSCALE);
theme->set_constant("hseparation", "Tree", (extra_spacing + default_margin_size) * EDSCALE);
theme->set_constant("guide_width", "Tree", border_width);
theme->set_constant("item_margin", "Tree", 3 * default_margin_size * EDSCALE);
theme->set_constant("button_margin", "Tree", default_margin_size * EDSCALE);
- theme->set_constant("draw_relationship_lines", "Tree", 0);
+ theme->set_constant("draw_relationship_lines", "Tree", relationship_line_opacity >= 0.01);
+ theme->set_constant("draw_guides", "Tree", relationship_line_opacity < 0.01);
theme->set_constant("scroll_border", "Tree", default_margin_size * EDSCALE);
theme->set_constant("scroll_speed", "Tree", 12);
@@ -817,6 +821,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("read_only", "LineEdit", style_widget_disabled);
theme->set_color("read_only", "LineEdit", font_color_disabled);
theme->set_color("font_color", "LineEdit", font_color);
+ theme->set_color("font_color_selected", "LineEdit", mono_color);
theme->set_color("cursor_color", "LineEdit", font_color);
theme->set_color("selection_color", "LineEdit", font_color_selection);
theme->set_color("clear_button_color", "LineEdit", font_color);
@@ -1101,7 +1106,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color caret_color = mono_color;
const Color caret_background_color = mono_color.inverted();
const Color text_selected_color = dark_color_3;
- const Color selection_color = alpha2;
+ const Color selection_color = accent_color * Color(1, 1, 1, 0.35);
const Color brace_mismatch_color = error_color;
const Color current_line_color = alpha1;
const Color line_length_guideline_color = dark_theme ? base_color : background_color;