1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Merge pull request #113252 from bruvzg/ed_nat_menu_theme

[Editor] Simplify native menu icon generation.
This commit is contained in:
Rémi Verschelde
2025-12-01 11:49:24 +01:00
6 changed files with 45 additions and 71 deletions

View File

@@ -2617,18 +2617,6 @@ Variant Window::get_theme_item(Theme::DataType p_data_type, const StringName &p_
Ref<Texture2D> Window::get_editor_theme_icon(const StringName &p_name) const {
return get_theme_icon(p_name, SNAME("EditorIcons"));
}
Ref<Texture2D> Window::get_editor_theme_native_menu_icon(const StringName &p_name, bool p_global_menu, bool p_dark_mode) const {
if (!p_global_menu) {
return get_theme_icon(p_name, SNAME("EditorIcons"));
}
if (p_dark_mode && has_theme_icon(String(p_name) + "Dark", SNAME("EditorIcons"))) {
return get_theme_icon(String(p_name) + "Dark", SNAME("EditorIcons"));
} else if (!p_dark_mode && has_theme_icon(String(p_name) + "Light", SNAME("EditorIcons"))) {
return get_theme_icon(String(p_name) + "Light", SNAME("EditorIcons"));
}
return get_theme_icon(p_name, SNAME("EditorIcons"));
}
#endif
bool Window::has_theme_icon(const StringName &p_name, const StringName &p_theme_type) const {

View File

@@ -495,7 +495,6 @@ public:
Variant get_theme_item(Theme::DataType p_data_type, const StringName &p_name, const StringName &p_theme_type = StringName()) const;
#ifdef TOOLS_ENABLED
Ref<Texture2D> get_editor_theme_icon(const StringName &p_name) const;
Ref<Texture2D> get_editor_theme_native_menu_icon(const StringName &p_name, bool p_global_menu, bool p_dark_mode) const;
#endif
bool has_theme_icon_override(const StringName &p_name) const;