Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.cpp (C++)

Code before:

		case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
			set_freelook_active(false);
		} break;

		case NOTIFICATION_ENTER_TREE: {
			surface->connect(SceneStringName(draw), callable_mp(this, &Node3DEditorViewport::_draw));
			surface->connect(SceneStringName(gui_input), callable_mp(this, &Node3DEditorViewport::_sinput));
			surface->connect(SceneStringName(mouse_entered), callable_mp(this, &Node3DEditorViewport::_surface_mouse_enter));
			surface->connect(SceneStringName(mouse_exited), callable_mp(this, &Node3DEditorViewport::_surface_mouse_exit));
			surface->connect(SceneStringName(focus_entered), callable_mp(this, &Node3DEditorViewport::_surface_focus_enter));
			surface->connect(SceneStringName(focus_exited), callable_mp(this, &Node3DEditorViewport::_surface_focus_exit));

			_init_gizmo_instance(index);
		} break;

		case NOTIFICATION_EXIT_TREE: {
			_finish_gizmo_instances();
		} break;

		case NOTIFICATION_THEME_CHANGED: {
			view_menu->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
			preview_camera->set_icon(get_editor_theme_icon(SNAME("Camera3D")));
			Control *gui_base = EditorNode::get_singleton()->get_gui_base();

			view_menu->begin_bulk_theme_override();
			view_menu->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			view_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			view_menu->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			view_menu->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			view_menu->add_theme_style_override("disabled", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			view_menu->end_bulk_theme_override();

			preview_camera->begin_bulk_theme_override();
			preview_camera->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			preview_camera->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			preview_camera->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			preview_camera->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			preview_camera->add_theme_style_override("disabled", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			preview_camera->end_bulk_theme_override();

			frame_time_gradient->set_color(0, get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
			frame_time_gradient->set_color(1, get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
			frame_time_gradient->set_color(2, get_theme_color(SNAME("error_color"), EditorStringName(Editor)));

			info_label->add_theme_style_override(CoreStringName(normal), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));

			frame_time_panel->add_theme_style_override(SceneStringName(panel), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
			// Set a minimum width to prevent the width from changing all the time
			// when numbers vary rapidly. This minimum width is set based on a
			// GPU time of 999.99 ms in the current editor language.

Review comment (suggestion):
```suggestion
			const Ref<StyleBox> &information_3d_stylebox = gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles));
```

Code after:

		case NOTIFICATION_WM_WINDOW_FOCUS_OUT: {
			set_freelook_active(false);
		} break;

		case NOTIFICATION_ENTER_TREE: {
			surface->connect(SceneStringName(draw), callable_mp(this, &Node3DEditorViewport::_draw));
			surface->connect(SceneStringName(gui_input), callable_mp(this, &Node3DEditorViewport::_sinput));
			surface->connect(SceneStringName(mouse_entered), callable_mp(this, &Node3DEditorViewport::_surface_mouse_enter));
			surface->connect(SceneStringName(mouse_exited), callable_mp(this, &Node3DEditorViewport::_surface_mouse_exit));
			surface->connect(SceneStringName(focus_entered), callable_mp(this, &Node3DEditorViewport::_surface_focus_enter));
			surface->connect(SceneStringName(focus_exited), callable_mp(this, &Node3DEditorViewport::_surface_focus_exit));

			_init_gizmo_instance(index);
		} break;

		case NOTIFICATION_EXIT_TREE: {
			_finish_gizmo_instances();
		} break;

		case NOTIFICATION_THEME_CHANGED: {
			view_menu->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
			preview_camera->set_icon(get_editor_theme_icon(SNAME("Camera3D")));
			Control *gui_base = EditorNode::get_singleton()->get_gui_base();

			const Ref<StyleBox> &information_3d_stylebox = gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles));

			view_menu->begin_bulk_theme_override();
			view_menu->add_theme_style_override(CoreStringName(normal), information_3d_stylebox);
			view_menu->add_theme_style_override("normal_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("hover", information_3d_stylebox);
			view_menu->add_theme_style_override("hover_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("hover_pressed", information_3d_stylebox);
			view_menu->add_theme_style_override("hover_pressed_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override(SceneStringName(pressed), information_3d_stylebox);
			view_menu->add_theme_style_override("pressed_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("focus", information_3d_stylebox);
			view_menu->add_theme_style_override("focus_mirrored", information_3d_stylebox);
			view_menu->add_theme_style_override("disabled", information_3d_stylebox);
			view_menu->add_theme_style_override("disabled_mirrored", information_3d_stylebox);
			view_menu->end_bulk_theme_override();

			preview_camera->begin_bulk_theme_override();
			preview_camera->add_theme_style_override(CoreStringName(normal), information_3d_stylebox);
			preview_camera->add_theme_style_override("normal_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover_pressed", information_3d_stylebox);
			preview_camera->add_theme_style_override("hover_pressed_mirrored", information_3d_stylebox);
			preview_camera->add_theme_style_override(SceneStringName(pressed), information_3d_stylebox);
			preview_camera->add_theme_style_override("pressed_mirrored", information_3d_stylebox);