diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-03-15 16:51:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-15 16:51:07 +0100 |
commit | 41edfc88a3f82e643ad3f4613de7a787a00ee68a (patch) | |
tree | 7786c512fc019d4b2542378f281351cd2326bc2e /editor/plugins/shader_editor_plugin.cpp | |
parent | 51bbcbdec2f971ed0113992b34335ef3c9873e79 (diff) | |
parent | 0ac6e6acbe15b0a7ceddbdaea49ded083f2f7f5e (diff) | |
download | redot-engine-41edfc88a3f82e643ad3f4613de7a787a00ee68a.tar.gz |
Merge pull request #59169 from timothyqiu/icon-for-theme
Diffstat (limited to 'editor/plugins/shader_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 02f11bb82f..dbe6ca192c 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -435,8 +435,16 @@ void ShaderEditor::_menu_option(int p_option) { } void ShaderEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_WM_WINDOW_FOCUS_IN) { - _check_for_external_edit(); + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + PopupMenu *popup = help_menu->get_popup(); + popup->set_item_icon(popup->get_item_index(HELP_DOCS), get_theme_icon(SNAME("Instance"), SNAME("EditorIcons"))); + } break; + + case NOTIFICATION_WM_WINDOW_FOCUS_IN: { + _check_for_external_edit(); + } break; } } @@ -772,7 +780,7 @@ ShaderEditor::ShaderEditor() { help_menu = memnew(MenuButton); help_menu->set_text(TTR("Help")); help_menu->set_switch_on_hover(true); - help_menu->get_popup()->add_icon_item(EditorNode::get_singleton()->get_gui_base()->get_theme_icon(SNAME("Instance"), SNAME("EditorIcons")), TTR("Online Docs"), HELP_DOCS); + help_menu->get_popup()->add_item(TTR("Online Docs"), HELP_DOCS); help_menu->get_popup()->connect("id_pressed", callable_mp(this, &ShaderEditor::_menu_option)); add_child(main_container); |