Repository: godotengine/godot
File: editor/scene/2d/tiles/tile_map_layer_editor.cpp (C++)

Code before:
		_update_tiles_list();
	}
}

void TileMapLayerEditorTerrainsPlugin::update_layout(EditorDock::DockLayout p_layout) {
	bool is_vertical = (p_layout == EditorDock::DockLayout::DOCK_LAYOUT_VERTICAL);
	// Main Panel.
	main_box_container->set_vertical(is_vertical);
	tilemap_tab_terrains->move_child(terrains_tree, is_vertical ? 1 : 0);
	tilemap_tab_terrains->set_vertical(is_vertical);

	// Toolbar.
	tilemap_tiles_tools_buttons->set_vertical(is_vertical);
	tools_settings->set_vertical(is_vertical);
	tools_settings_vsep->set_vertical(is_vertical);
}

TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
	wide_toolbar = memnew(HBoxContainer);
	main_box_container = memnew(BoxContainer);
	main_box_container->set_vertical(true);
	// FIXME: This can trigger theme updates when the nodes that we want to update are not yet available.
	// The toolbar should be extracted to a dedicated control and theme updates should be handled through
	// the notification.
	main_box_container->connect(SceneStringName(theme_changed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_theme));
	main_box_container->set_name(TTR("Terrains"));

	tilemap_tab_terrains = memnew(SplitContainer);
	tilemap_tab_terrains->set_vertical(false);
	tilemap_tab_terrains->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	tilemap_tab_terrains->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	main_box_container->add_child(tilemap_tab_terrains);

	terrains_tree = memnew(Tree);
	terrains_tree->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tree->set_stretch_ratio(0.25);
	terrains_tree->set_custom_minimum_size(Size2(70, 0) * EDSCALE);
	terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
	terrains_tree->set_hide_root(true);
	terrains_tree->set_theme_type_variation("ItemListSecondary");
	terrains_tree->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_tiles_list));
	tilemap_tab_terrains->add_child(terrains_tree);

	terrains_tile_list = memnew(ItemList);
	terrains_tile_list->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED);
	terrains_tile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tile_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tile_list->set_max_columns(0);
	terrains_tile_list->set_same_column_width(true);
	terrains_tile_list->set_fixed_icon_size(Size2(32, 32) * EDSCALE);

Review comment (suggestion):
If you are changing this line anyway...
```suggestion
	main_box_container->set_name(TTRC("Terrains"));
```

Code after:

void TileMapLayerEditorTerrainsPlugin::update_layout(EditorDock::DockLayout p_layout) {
	bool is_vertical = (p_layout == EditorDock::DockLayout::DOCK_LAYOUT_VERTICAL);
	// Main Panel.
	main_box_container->set_vertical(is_vertical);
	tilemap_tab_terrains->move_child(terrains_tree, is_vertical ? 1 : 0);
	tilemap_tab_terrains->set_vertical(is_vertical);

	// Toolbar.
	tilemap_tiles_tools_buttons->set_vertical(is_vertical);
	tools_settings->set_vertical(is_vertical);
	tools_settings_vsep->set_vertical(is_vertical);
}

TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
	wide_toolbar = memnew(HBoxContainer);
	main_box_container = memnew(BoxContainer);
	main_box_container->set_vertical(true);
	// FIXME: This can trigger theme updates when the nodes that we want to update are not yet available.
	// The toolbar should be extracted to a dedicated control and theme updates should be handled through
	// the notification.
	main_box_container->connect(SceneStringName(theme_changed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_theme));
	main_box_container->set_name(TTRC("Terrains"));

	tilemap_tab_terrains = memnew(SplitContainer);
	tilemap_tab_terrains->set_vertical(false);
	tilemap_tab_terrains->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	tilemap_tab_terrains->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	main_box_container->add_child(tilemap_tab_terrains);

	terrains_tree = memnew(Tree);
	terrains_tree->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tree->set_stretch_ratio(0.25);
	terrains_tree->set_custom_minimum_size(Size2(70, 0) * EDSCALE);
	terrains_tree->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
	terrains_tree->set_hide_root(true);
	terrains_tree->set_theme_type_variation("ItemListSecondary");
	terrains_tree->connect(SceneStringName(item_selected), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_tiles_list));
	tilemap_tab_terrains->add_child(terrains_tree);

	terrains_tile_list = memnew(ItemList);
	terrains_tile_list->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_DISABLED);
	terrains_tile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tile_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
	terrains_tile_list->set_max_columns(0);
	terrains_tile_list->set_same_column_width(true);
	terrains_tile_list->set_fixed_icon_size(Size2(32, 32) * EDSCALE);
	terrains_tile_list->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST);
	tilemap_tab_terrains->add_child(terrains_tile_list);