### Godot version

v4.1.1.stable.official [bd6af8e0e]

### System information

Godot v4.1.1.stable - Debian GNU/Linux trixie/sid trixie - Vulkan (Compatibility) - Mesa Intel(R) HD Graphics 520 (SKL GT2) () - Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz (4 Threads)

### Issue description

After right clicking in thet "Filter Nodes" menu in the scene tree dock, the sub-menu is populated with a "Search" icon.

If I later switch themes in the same session, this icon is never updated to match the new theme.

![image](https://github.com/godotengine/godot/assets/660911/14336bb3-12ca-48c8-b030-8ada6ac27ec6)


### Steps to reproduce

1. Right click in the "Filter Nodes" menu in scene tree dock
2. Switch themes
3. Right click again in the "Filter Nodes" menu

Expected result: Icon has updated to match the theme I am currently using
Actual result: Icon is still using the theme I launched Godot with

### Minimal reproduction project

N/A
}
	if (profile_allow_script_editing) {
		bool add_separator = false;
		if (full_selection.size() == 1) {
			add_separator = true;
			menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT);
			if (existing_script.is_valid()) {
				menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptExtend"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/extend_script"), TOOL_EXTEND_SCRIPT);
			}
		}
		if (existing_script.is_valid() && existing_script_removable) {
			add_separator = true;
			menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptRemove"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
		} else if (full_selection.size() > 1) {
			bool script_exists = false;
			for (Node *E : full_selection) {
				if (!E->get_script().is_null()) {
					script_exists = true;
					break;
				}
			}
			if (script_exists) {
				add_separator = true;
				menu->add_icon_shortcut(get_theme_icon(SNAME("ScriptRemove"), SNAME("EditorIcons")), ED_GET_SHORTCUT("scene_tree/detach_script"), TOOL_DETACH_SCRIPT);
			}
		}
		if (add_separator && profile_allow_editing) {
			menu->add_separator();
		}
	}