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

Code before:
	viewport->set_focus_mode(FOCUS_ALL);
	viewport->connect(SceneStringName(draw), callable_mp(this, &CanvasItemEditor::_draw_viewport));
	viewport->connect(SceneStringName(gui_input), callable_mp(this, &CanvasItemEditor::_gui_input_viewport));
	viewport->connect(SceneStringName(focus_exited), callable_mp(panner.ptr(), &ViewPanner::release_pan_key));

	h_scroll = memnew(HScrollBar);
	viewport->add_child(h_scroll);
	h_scroll->connect(SceneStringName(value_changed), callable_mp(this, &CanvasItemEditor::_update_scroll));
	h_scroll->hide();

	v_scroll = memnew(VScrollBar);
	viewport->add_child(v_scroll);
	v_scroll->connect(SceneStringName(value_changed), callable_mp(this, &CanvasItemEditor::_update_scroll));
	v_scroll->hide();

	viewport->add_child(controls_vb);

	select_button = memnew(Button);
	select_button->set_theme_type_variation(SceneStringName(FlatButton));
	main_menu_hbox->add_child(select_button);
	select_button->set_toggle_mode(true);
	select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT));
	select_button->set_pressed(true);
	select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTRC("Select Mode"), Key::Q, true));
	select_button->set_shortcut_context(this);
	select_button->set_accessibility_name(TTRC("Select Mode"));

	main_menu_hbox->add_child(memnew(VSeparator));

	move_button = memnew(Button);
	move_button->set_theme_type_variation(SceneStringName(FlatButton));
	main_menu_hbox->add_child(move_button);
	move_button->set_toggle_mode(true);
	move_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_MOVE));
	move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTRC("Move Mode"), Key::W, true));
	move_button->set_shortcut_context(this);
	move_button->set_tooltip_text(TTRC("Move Mode"));
	move_button->set_accessibility_name(TTRC("Move Mode"));

	rotate_button = memnew(Button);
	rotate_button->set_theme_type_variation(SceneStringName(FlatButton));
	main_menu_hbox->add_child(rotate_button);
	rotate_button->set_toggle_mode(true);
	rotate_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_ROTATE));
	rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTRC("Rotate Mode"), Key::E, true));
	rotate_button->set_shortcut_context(this);
	rotate_button->set_tooltip_text(TTRC("Rotate Mode"));
	rotate_button->set_accessibility_name(TTRC("Rotate Mode"));

	scale_button = memnew(Button);
	scale_button->set_theme_type_variation(SceneStringName(FlatButton));

Review comment (suggestion):
```suggestion
	select_button->set_shortcut_context(this);
	select_button->->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
```

Code after:
	viewport->set_focus_mode(FOCUS_ALL);
	viewport->connect(SceneStringName(draw), callable_mp(this, &CanvasItemEditor::_draw_viewport));
	viewport->connect(SceneStringName(gui_input), callable_mp(this, &CanvasItemEditor::_gui_input_viewport));
	viewport->connect(SceneStringName(focus_exited), callable_mp(panner.ptr(), &ViewPanner::release_pan_key));

	h_scroll = memnew(HScrollBar);
	viewport->add_child(h_scroll);
	h_scroll->connect(SceneStringName(value_changed), callable_mp(this, &CanvasItemEditor::_update_scroll));
	h_scroll->hide();

	v_scroll = memnew(VScrollBar);
	viewport->add_child(v_scroll);
	v_scroll->connect(SceneStringName(value_changed), callable_mp(this, &CanvasItemEditor::_update_scroll));
	v_scroll->hide();

	viewport->add_child(controls_vb);

	select_button = memnew(Button);
	select_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
	select_button->set_theme_type_variation(SceneStringName(FlatButton));
	main_menu_hbox->add_child(select_button);
	select_button->set_toggle_mode(true);
	select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT));
	select_button->set_pressed(true);
	select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTRC("Select Mode"), Key::Q, true));
	select_button->set_shortcut_context(this);
	select_button->set_accessibility_name(TTRC("Select Mode"));

	main_menu_hbox->add_child(memnew(VSeparator));

	move_button = memnew(Button);
	move_button->set_theme_type_variation(SceneStringName(FlatButton));
	main_menu_hbox->add_child(move_button);
	move_button->set_toggle_mode(true);
	move_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_MOVE));
	move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTRC("Move Mode"), Key::W, true));
	move_button->set_shortcut_context(this);
	move_button->set_tooltip_text(TTRC("Move Mode"));
	move_button->set_accessibility_name(TTRC("Move Mode"));

	rotate_button = memnew(Button);
	rotate_button->set_theme_type_variation(SceneStringName(FlatButton));
	main_menu_hbox->add_child(rotate_button);
	rotate_button->set_toggle_mode(true);
	rotate_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_ROTATE));
	rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTRC("Rotate Mode"), Key::E, true));
	rotate_button->set_shortcut_context(this);
	rotate_button->set_tooltip_text(TTRC("Rotate Mode"));
	rotate_button->set_accessibility_name(TTRC("Rotate Mode"));

	scale_button = memnew(Button);