The folder tree itself only ever shows folders, but if you want something similar in the file display when using Flat View then you can turn on a filter which hides all files.
The quickest way to do that on an ad-hoc basis is to push * to open the filter bar, then click the icon on the left which hides all files.
If you want to do it via a toolbar button or hotkey then that's also possible. Let us know exactly how you want it to work and we can give details. (e.g. You might want a button that turns on the filter and one of the Flat View modes at once, and then acts as a toggle for both.)
Thank you. This indeed does what I want.
It would be great if this could be assigned to a toolbar button that turns the "flat tree view + filter" on and off (so, at once).
I would love to use this button. Unfortunately, the linked instructions seem to go over my head. It is also not clear to me which exact part of those instructions should be followed here.
I already tried the script code with both variants "JScript" and "VBScript", but the button doesn't seem work either way. Instead, "Script Error" is displayed in the status bar when clicking the button.
Strangely however, the button leads to a different result in my left Lister as compared to the right Lister -- in the same folder.
Clicking the button in the left Lister shows all files and folders in a flat view. Doing so in the right Lister shows only the files and not the folders.
I don't understand why this is the case.
In addition, I would like to see only the folders listed (flat), not the files, when the button is used.
See if Preferences / Folders / Folder Formats / Folder Type Formats / Flat View is turned on; if it is, try turning it off and see if it makes a difference.
I think I found the problem, if I turn on "Hide Filter" the command button doesn't work properly, but if I turn off "Hide Filter" the command button works as it should.
That'll mean the filename filter is overridden after flat view turns on. You could reorder the last two lines of the command to set the filter after turning on flat-view, but it'll be a bit slower that way. If you aren't using the filters in the folder format then turning off that page is the best option.
Those Hide Filters and Show Folders pages in the Flat View folder format should be off by default, or at least are off in my own configuration. No reason to turn them on unless you want that format to always set/reset the filters when turning on Flat View.