Merge pull request #8895 from nunodonato/newdefaultcolors

Improved default colors for the new theme
This commit is contained in:
Rémi Verschelde 2017-05-25 08:40:11 +02:00 committed by GitHub
commit 6a332b3575
2 changed files with 16 additions and 14 deletions

View file

@ -503,8 +503,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["interface/source_font_size"] = PropertyInfo(Variant::INT, "interface/source_font_size", PROPERTY_HINT_RANGE, "8,96,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/custom_font", "");
hints["interface/custom_font"] = PropertyInfo(Variant::STRING, "interface/custom_font", PROPERTY_HINT_GLOBAL_FILE, "*.fnt", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/custom_theme", "");
hints["interface/custom_theme"] = PropertyInfo(Variant::STRING, "interface/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/dim_editor_on_dialog_popup", true);
set("interface/dim_amount", 0.6f);
hints["interface/dim_amount"] = PropertyInfo(Variant::REAL, "interface/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT);
@ -513,6 +511,15 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("interface/separate_distraction_mode", false);
set("interface/theme/base_color", Color(0.3, 0.3, 0.3, 1));
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(0.5, 0.5, 0.6, 1));
hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("interface/theme/contrast", 0.2);
hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
set("interface/theme/custom_theme", "");
hints["interface/theme/custom_theme"] = PropertyInfo(Variant::STRING, "interface/theme/custom_theme", PROPERTY_HINT_GLOBAL_FILE, "*.res,*.tres,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("filesystem/directories/autoscan_project_path", "");
hints["filesystem/directories/autoscan_project_path"] = PropertyInfo(Variant::STRING, "filesystem/directories/autoscan_project_path", PROPERTY_HINT_GLOBAL_DIR);
set("filesystem/directories/default_project_path", "");
@ -606,11 +613,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("editors/poly_editor/point_grab_radius", 8);
set("editors/theme/base_color", Color(0.3, 0.3, 0.3, 1));
hints["editors/theme/base_color"] = PropertyInfo(Variant::COLOR, "editors/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
set("editors/theme/contrast", 0.2);
hints["editors/theme/contrast"] = PropertyInfo(Variant::REAL, "editors/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
set("run/window_placement/rect", 0);
hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Default,Centered,Custom Position,Force Maximized,Force Full Screen");
String screen_hints = TTR("Default (Same as Editor)");

View file

@ -95,16 +95,16 @@ Ref<Theme> create_editor_theme() {
editor_register_icons(theme);
// Define colors
Color highlight_color = EDITOR_DEF("editors/theme/highlight_color", Color::html("#6ca9f3"));
Color base_color = EDITOR_DEF("editors/theme/base_color", Color::html("#2e3742"));
float contrast = EDITOR_DEF("editors/theme/contrast", 0.2);
Color highlight_color = EDITOR_DEF("interface/theme/highlight_color", Color::html("#b79047"));
Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#213d4c"));
float contrast = EDITOR_DEF("interface/theme/contrast", 0.25);
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 * 2);
Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 3);
Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);
Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 2);
Color light_color_1 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast);
Color light_color_2 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast * 2);
Color light_color_2 = base_color.linear_interpolate(Color(1, 1, 1, 1), contrast * 1.5);
theme->set_color("highlight_color", "Editor", highlight_color);
theme->set_color("base_color", "Editor", base_color);
@ -425,7 +425,7 @@ Ref<Theme> create_editor_theme() {
Ref<Theme> create_custom_theme() {
Ref<Theme> theme;
String custom_theme = EditorSettings::get_singleton()->get("interface/custom_theme");
String custom_theme = EditorSettings::get_singleton()->get("interface/theme/custom_theme");
if (custom_theme != "") {
theme = ResourceLoader::load(custom_theme);
}