mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Match status icons colors with the theme status colors.
This commit is contained in:
parent
04291c1e77
commit
d31215e4cd
@ -112,6 +112,7 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = tr
|
||||
|
||||
#ifdef SVG_ENABLED
|
||||
Dictionary dark_icon_color_dictionary;
|
||||
if (!dark_theme) {
|
||||
//convert color: FROM TO
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#e0e0e0", "#4f4f4f"); // common icon color
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffffff", "#000000"); // white
|
||||
@ -123,10 +124,6 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = tr
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#708cea", "#0843ff"); // 2d dark
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#a5efac", "#29d739"); // control
|
||||
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff8484", "#ff3333"); // error
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00db50"); // success
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffd684", "#ffad07"); // warning
|
||||
|
||||
// rainbow
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff7070", "#ff2929"); // red
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffeb70", "#ffe337"); // yellow
|
||||
@ -144,9 +141,20 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = tr
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ffd684", "#fea900"); // mesh (orange)
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#40a2ff", "#68b6ff"); // shape (blue)
|
||||
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ff8484", "#ff3333"); // remove (red)
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84ffb1", "#00db50"); // add (green)
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#84c2ff", "#5caeff"); // selection (blue)
|
||||
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#ea686c", "#e3383d"); // key xform (red)
|
||||
}
|
||||
|
||||
// these ones should be converted even if we are using a dark theme
|
||||
const Color error_color = p_theme->get_color("error_color", "Editor");
|
||||
const Color success_color = p_theme->get_color("success_color", "Editor");
|
||||
const Color warning_color = p_theme->get_color("warning_color", "Editor");
|
||||
dark_icon_color_dictionary[Color::html("#ff5d5d")] = error_color;
|
||||
dark_icon_color_dictionary[Color::html("#45ff8b")] = success_color;
|
||||
dark_icon_color_dictionary[Color::html("#ffdd65")] = warning_color;
|
||||
|
||||
List<String> exceptions;
|
||||
exceptions.push_back("EditorPivot");
|
||||
@ -160,14 +168,14 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = tr
|
||||
|
||||
clock_t begin_time = clock();
|
||||
|
||||
ImageLoaderSVG::set_convert_colors(dark_theme ? NULL : &dark_icon_color_dictionary);
|
||||
ImageLoaderSVG::set_convert_colors(&dark_icon_color_dictionary);
|
||||
|
||||
// generate icons
|
||||
if (!only_thumbs)
|
||||
for (int i = 0; i < editor_icons_count; i++) {
|
||||
List<String>::Element *is_exception = exceptions.find(editor_icons_names[i]);
|
||||
if (is_exception) exceptions.erase(is_exception);
|
||||
Ref<ImageTexture> icon = editor_generate_icon(i, !dark_theme && !is_exception);
|
||||
Ref<ImageTexture> icon = editor_generate_icon(i, !is_exception);
|
||||
p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user