diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_export.cpp | 1 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 39 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 8 |
3 files changed, 35 insertions, 13 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index e7358c0b80..ad77f4641d 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -1866,7 +1866,6 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr if (err == OK && !so_files.is_empty()) { // If shared object files, copy them. - da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); for (int i = 0; i < so_files.size() && err == OK; i++) { String src_path = ProjectSettings::get_singleton()->globalize_path(so_files[i].path); String target_path; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 28feac5d2b..4bd4e073d7 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -288,17 +288,40 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme = dark_icon_color_dictionary[Color::html("#5fff97")] = success_color; dark_icon_color_dictionary[Color::html("#ffdd65")] = warning_color; + // Use the accent color for some icons (checkbox, radio, toggle, etc.). + Dictionary accent_color_icon_color_dictionary; + Set<StringName> accent_color_icons; + + const Color accent_color = p_theme->get_color(SNAME("accent_color"), SNAME("Editor")); + accent_color_icon_color_dictionary[Color::html("699ce8")] = accent_color; + if (accent_color.get_luminance() > 0.75) { + accent_color_icon_color_dictionary[Color::html("ffffff")] = Color(0.2, 0.2, 0.2); + } + + accent_color_icons.insert("GuiChecked"); + accent_color_icons.insert("GuiRadioChecked"); + accent_color_icons.insert("GuiIndeterminate"); + accent_color_icons.insert("GuiToggleOn"); + accent_color_icons.insert("GuiToggleOnMirrored"); + accent_color_icons.insert("PlayOverlay"); + // Generate icons. if (!p_only_thumbs) { for (int i = 0; i < editor_icons_count; i++) { - float saturation = p_icon_saturation; + Ref<ImageTexture> icon; - if (strcmp(editor_icons_names[i], "DefaultProjectIcon") == 0 || strcmp(editor_icons_names[i], "Godot") == 0 || strcmp(editor_icons_names[i], "Logo") == 0) { - saturation = 1.0; - } + if (accent_color_icons.has(editor_icons_names[i])) { + icon = editor_generate_icon(i, true, EDSCALE, 1.0, accent_color_icon_color_dictionary); + } else { + float saturation = p_icon_saturation; + + if (strcmp(editor_icons_names[i], "DefaultProjectIcon") == 0 || strcmp(editor_icons_names[i], "Godot") == 0 || strcmp(editor_icons_names[i], "Logo") == 0) { + saturation = 1.0; + } - const int is_exception = exceptions.has(editor_icons_names[i]); - const Ref<ImageTexture> icon = editor_generate_icon(i, !is_exception, EDSCALE, saturation, dark_icon_color_dictionary); + const int is_exception = exceptions.has(editor_icons_names[i]); + icon = editor_generate_icon(i, !is_exception, EDSCALE, saturation, dark_icon_color_dictionary); + } p_theme->set_icon(editor_icons_names[i], SNAME("EditorIcons"), icon); } @@ -514,8 +537,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { // Register icons + font - // The resolution and the icon color (dark_theme bool) has not changed, so we do not regenerate the icons. - if (p_theme != nullptr && fabs(p_theme->get_constant(SNAME("scale"), SNAME("Editor")) - EDSCALE) < 0.00001 && (bool)p_theme->get_constant(SNAME("dark_theme"), SNAME("Editor")) == dark_theme && prev_icon_saturation == icon_saturation) { + // The editor scale, icon color (dark_theme bool), icon saturation, and accent color has not changed, so we do not regenerate the icons. + if (p_theme != nullptr && fabs(p_theme->get_constant(SNAME("scale"), SNAME("Editor")) - EDSCALE) < 0.00001 && (bool)p_theme->get_constant(SNAME("dark_theme"), SNAME("Editor")) == dark_theme && prev_icon_saturation == icon_saturation && p_theme->get_color(SNAME("accent_color"), SNAME("Editor")) == accent_color) { // Register already generated icons. for (int i = 0; i < editor_icons_count; i++) { theme->set_icon(editor_icons_names[i], SNAME("EditorIcons"), p_theme->get_icon(editor_icons_names[i], SNAME("EditorIcons"))); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 1468d63daf..20bd145299 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -997,7 +997,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int hbc->add_theme_constant_override("separation", 5 * EDSCALE); Button *first = memnew(Button); - first->set_text(TTR("First")); + first->set_text(TTR("First", "Pagination")); if (p_page != 0) { first->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(0)); } else { @@ -1007,7 +1007,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int hbc->add_child(first); Button *prev = memnew(Button); - prev->set_text(TTR("Previous")); + prev->set_text(TTR("Previous", "Pagination")); if (p_page > 0) { prev->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(p_page - 1)); } else { @@ -1037,7 +1037,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int } Button *next = memnew(Button); - next->set_text(TTR("Next")); + next->set_text(TTR("Next", "Pagination")); if (p_page < p_page_count - 1) { next->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(p_page + 1)); } else { @@ -1048,7 +1048,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int hbc->add_child(next); Button *last = memnew(Button); - last->set_text(TTR("Last")); + last->set_text(TTR("Last", "Pagination")); if (p_page != p_page_count - 1) { last->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search), varray(p_page_count - 1)); } else { |