1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

[Editor] Change global menu icons theme independently of editor theme.

This commit is contained in:
Pāvels Nadtočajevs
2025-03-07 08:59:27 +02:00
parent f2cc3f1275
commit fd98c963ba
6 changed files with 96 additions and 34 deletions

View File

@@ -2372,6 +2372,18 @@ 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 {