From ff0a149de94b723a6013fb224ec5a8d0bfada68d Mon Sep 17 00:00:00 2001 From: toger5 Date: Wed, 30 Aug 2017 21:19:06 +0200 Subject: [PATCH] added setting for icon/font color: auto,dark,light --- editor/editor_settings.cpp | 2 ++ editor/editor_themes.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index d2b87e63af3..2e692452cce 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -571,6 +571,8 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { set("interface/theme/preset", 0); hints["interface/theme/preset"] = PropertyInfo(Variant::INT, "interface/theme/preset", PROPERTY_HINT_ENUM, "Default,Grey,Godot 2,Arc,Light,Custom", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/theme/icon_and_font_color", 0); + hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); set("interface/theme/base_color", Color::html("#323b4f")); hints["interface/theme/highlight_color"] = PropertyInfo(Variant::COLOR, "interface/theme/highlight_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); set("interface/theme/highlight_color", Color::html("#699ce8")); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index a04cfed9061..f09fe9d9aee 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -194,6 +194,7 @@ Ref create_editor_theme(const Ref p_theme) { float contrast = EDITOR_DEF("interface/theme/contrast", default_contrast); int preset = EDITOR_DEF("interface/theme/preset", 0); + int icon_font_color_setting = EDITOR_DEF("interface/theme/icon_and_font_color", 0); bool highlight_tabs = EDITOR_DEF("interface/theme/highlight_tabs", false); int border_size = EDITOR_DEF("interface/theme/border_size", 1); @@ -226,7 +227,9 @@ Ref create_editor_theme(const Ref p_theme) { } //Colors - bool dark_theme = ((base_color.r + base_color.g + base_color.b) / 3.0) < 0.5; + int AUTO_COLOR = 0; + int LIGHT_COLOR = 2; + bool dark_theme = (icon_font_color_setting == AUTO_COLOR && ((base_color.r + base_color.g + base_color.b) / 3.0) < 0.5) || icon_font_color_setting == LIGHT_COLOR; Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast); Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);