To collapse all folders in the file structure view, click the Collapse All icon on the main toolbar:
This closes all open folders, excluding the root. If you wish to callapse the root as well, double click on it.
See also: How To Expand All Folders, How To Show All Differences.