added setting for icon/font color: auto,dark,light
This commit is contained in:
parent
7793bfc544
commit
ff0a149de9
|
@ -571,6 +571,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> 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"));
|
||||
|
|
|
@ -194,6 +194,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> 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<Theme> create_editor_theme(const Ref<Theme> 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);
|
||||
|
|
Loading…
Reference in New Issue