@@ -560,10 +560,10 @@ void EditorNode::_update_theme(bool p_skip_creation) {
560
560
distraction_free->set_button_icon (theme->get_icon (SNAME (" DistractionFree" ), EditorStringName (EditorIcons)));
561
561
distraction_free->add_theme_style_override (SceneStringName (pressed), theme->get_stylebox (CoreStringName (normal ), " FlatMenuButton" ));
562
562
563
- help_menu->set_item_icon (help_menu->get_item_index (HELP_SEARCH), help_menu-> get_editor_theme_native_menu_icon (SNAME (" HelpSearch" ), global_menu, dark_mode));
564
- help_menu->set_item_icon (help_menu->get_item_index (HELP_COPY_SYSTEM_INFO), help_menu-> get_editor_theme_native_menu_icon (SNAME (" ActionCopy" ), global_menu, dark_mode));
565
- help_menu->set_item_icon (help_menu->get_item_index (HELP_ABOUT), help_menu-> get_editor_theme_native_menu_icon (SNAME (" Godot" ), global_menu, dark_mode));
566
- help_menu->set_item_icon (help_menu->get_item_index (HELP_SUPPORT_GODOT_DEVELOPMENT), help_menu-> get_editor_theme_native_menu_icon (SNAME (" Heart" ), global_menu, dark_mode));
563
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_SEARCH), _get_editor_theme_native_menu_icon (SNAME (" HelpSearch" ), global_menu, dark_mode));
564
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_COPY_SYSTEM_INFO), _get_editor_theme_native_menu_icon (SNAME (" ActionCopy" ), global_menu, dark_mode));
565
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_ABOUT), _get_editor_theme_native_menu_icon (SNAME (" Godot" ), global_menu, dark_mode));
566
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_SUPPORT_GODOT_DEVELOPMENT), _get_editor_theme_native_menu_icon (SNAME (" Heart" ), global_menu, dark_mode));
567
567
568
568
if (EditorDebuggerNode::get_singleton ()->is_visible ()) {
569
569
bottom_panel->add_theme_style_override (SceneStringName (panel), theme->get_stylebox (SNAME (" BottomPanelDebuggerOverride" ), EditorStringName (EditorStyles)));
@@ -577,6 +577,18 @@ void EditorNode::_update_theme(bool p_skip_creation) {
577
577
editor_dock_manager->set_tab_icon_max_width (theme->get_constant (SNAME (" class_icon_size" ), EditorStringName (Editor)));
578
578
}
579
579
580
+ Ref<Texture2D> EditorNode::_get_editor_theme_native_menu_icon (const StringName &p_name, bool p_global_menu, bool p_dark_mode) const {
581
+ if (!p_global_menu) {
582
+ return theme->get_icon (p_name, SNAME (" EditorIcons" ));
583
+ }
584
+ if (p_dark_mode && theme->has_icon (String (p_name) + " Dark" , SNAME (" EditorIcons" ))) {
585
+ return theme->get_icon (String (p_name) + " Dark" , SNAME (" EditorIcons" ));
586
+ } else if (!p_dark_mode && theme->has_icon (String (p_name) + " Light" , SNAME (" EditorIcons" ))) {
587
+ return theme->get_icon (String (p_name) + " Light" , SNAME (" EditorIcons" ));
588
+ }
589
+ return theme->get_icon (p_name, SNAME (" EditorIcons" ));
590
+ }
591
+
580
592
void EditorNode::update_preview_themes (int p_mode) {
581
593
if (!scene_root->is_inside_tree ()) {
582
594
return ; // Too early.
@@ -3377,10 +3389,10 @@ void EditorNode::_check_system_theme_changed() {
3377
3389
// Update system menus.
3378
3390
bool dark_mode = DisplayServer::get_singleton ()->is_dark_mode ();
3379
3391
3380
- help_menu->set_item_icon (help_menu->get_item_index (HELP_SEARCH), help_menu-> get_editor_theme_native_menu_icon (SNAME (" HelpSearch" ), global_menu, dark_mode));
3381
- help_menu->set_item_icon (help_menu->get_item_index (HELP_COPY_SYSTEM_INFO), help_menu-> get_editor_theme_native_menu_icon (SNAME (" ActionCopy" ), global_menu, dark_mode));
3382
- help_menu->set_item_icon (help_menu->get_item_index (HELP_ABOUT), help_menu-> get_editor_theme_native_menu_icon (SNAME (" Godot" ), global_menu, dark_mode));
3383
- help_menu->set_item_icon (help_menu->get_item_index (HELP_SUPPORT_GODOT_DEVELOPMENT), help_menu-> get_editor_theme_native_menu_icon (SNAME (" Heart" ), global_menu, dark_mode));
3392
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_SEARCH), _get_editor_theme_native_menu_icon (SNAME (" HelpSearch" ), global_menu, dark_mode));
3393
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_COPY_SYSTEM_INFO), _get_editor_theme_native_menu_icon (SNAME (" ActionCopy" ), global_menu, dark_mode));
3394
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_ABOUT), _get_editor_theme_native_menu_icon (SNAME (" Godot" ), global_menu, dark_mode));
3395
+ help_menu->set_item_icon (help_menu->get_item_index (HELP_SUPPORT_GODOT_DEVELOPMENT), _get_editor_theme_native_menu_icon (SNAME (" Heart" ), global_menu, dark_mode));
3384
3396
editor_dock_manager->update_docks_menu ();
3385
3397
}
3386
3398
}
@@ -7671,23 +7683,23 @@ EditorNode::EditorNode() {
7671
7683
7672
7684
ED_SHORTCUT_AND_COMMAND (" editor/editor_help" , TTRC (" Search Help..." ), Key::F1);
7673
7685
ED_SHORTCUT_OVERRIDE (" editor/editor_help" , " macos" , KeyModifierMask::ALT | Key::SPACE);
7674
- help_menu->add_icon_shortcut (help_menu-> get_editor_theme_native_menu_icon (SNAME (" HelpSearch" ), global_menu, dark_mode), ED_GET_SHORTCUT (" editor/editor_help" ), HELP_SEARCH);
7686
+ help_menu->add_icon_shortcut (_get_editor_theme_native_menu_icon (SNAME (" HelpSearch" ), global_menu, dark_mode), ED_GET_SHORTCUT (" editor/editor_help" ), HELP_SEARCH);
7675
7687
help_menu->add_separator ();
7676
7688
help_menu->add_shortcut (ED_SHORTCUT_AND_COMMAND (" editor/online_docs" , TTRC (" Online Documentation" )), HELP_DOCS);
7677
7689
help_menu->add_shortcut (ED_SHORTCUT_AND_COMMAND (" editor/forum" , TTRC (" Forum" )), HELP_FORUM);
7678
7690
help_menu->add_shortcut (ED_SHORTCUT_AND_COMMAND (" editor/community" , TTRC (" Community" )), HELP_COMMUNITY);
7679
7691
help_menu->add_separator ();
7680
- help_menu->add_icon_shortcut (help_menu-> get_editor_theme_native_menu_icon (SNAME (" ActionCopy" ), global_menu, dark_mode), ED_SHORTCUT_AND_COMMAND (" editor/copy_system_info" , TTRC (" Copy System Info" )), HELP_COPY_SYSTEM_INFO);
7692
+ help_menu->add_icon_shortcut (_get_editor_theme_native_menu_icon (SNAME (" ActionCopy" ), global_menu, dark_mode), ED_SHORTCUT_AND_COMMAND (" editor/copy_system_info" , TTRC (" Copy System Info" )), HELP_COPY_SYSTEM_INFO);
7681
7693
help_menu->set_item_tooltip (-1 , TTR (" Copies the system info as a single-line text into the clipboard." ));
7682
7694
help_menu->add_shortcut (ED_SHORTCUT_AND_COMMAND (" editor/report_a_bug" , TTRC (" Report a Bug" )), HELP_REPORT_A_BUG);
7683
7695
help_menu->add_shortcut (ED_SHORTCUT_AND_COMMAND (" editor/suggest_a_feature" , TTRC (" Suggest a Feature" )), HELP_SUGGEST_A_FEATURE);
7684
7696
help_menu->add_shortcut (ED_SHORTCUT_AND_COMMAND (" editor/send_docs_feedback" , TTRC (" Send Docs Feedback" )), HELP_SEND_DOCS_FEEDBACK);
7685
7697
help_menu->add_separator ();
7686
7698
if (!global_menu || !OS::get_singleton ()->has_feature (" macos" )) {
7687
7699
// On macOS "Quit" and "About" options are in the "app" menu.
7688
- help_menu->add_icon_shortcut (help_menu-> get_editor_theme_native_menu_icon (SNAME (" Godot" ), global_menu, dark_mode), ED_SHORTCUT_AND_COMMAND (" editor/about" , TTRC (" About Godot..." )), HELP_ABOUT);
7700
+ help_menu->add_icon_shortcut (_get_editor_theme_native_menu_icon (SNAME (" Godot" ), global_menu, dark_mode), ED_SHORTCUT_AND_COMMAND (" editor/about" , TTRC (" About Godot..." )), HELP_ABOUT);
7689
7701
}
7690
- help_menu->add_icon_shortcut (help_menu-> get_editor_theme_native_menu_icon (SNAME (" Heart" ), global_menu, dark_mode), ED_SHORTCUT_AND_COMMAND (" editor/support_development" , TTRC (" Support Godot Development" )), HELP_SUPPORT_GODOT_DEVELOPMENT);
7702
+ help_menu->add_icon_shortcut (_get_editor_theme_native_menu_icon (SNAME (" Heart" ), global_menu, dark_mode), ED_SHORTCUT_AND_COMMAND (" editor/support_development" , TTRC (" Support Godot Development" )), HELP_SUPPORT_GODOT_DEVELOPMENT);
7691
7703
7692
7704
// Spacer to center 2D / 3D / Script buttons.
7693
7705
Control *right_spacer = memnew (Control);
0 commit comments