FileDialog: Show only directories with SelectDirectory

When a FileDialog is used to select a directory, displaying files is
rather unhelpful. This commit reduces the visual clutter.
This commit is contained in:
ragnara 2022-10-26 18:11:23 +02:00 committed by Grim Maple
parent 65d74b2945
commit 1c6f19aca4
1 changed files with 5 additions and 0 deletions

View File

@ -443,6 +443,11 @@ class FileDialog : Dialog, CustomGridCellAdapter {
if (executableFilterSelected()) {
attrFilter |= AttrFilter.executable;
}
if (_action.id == ACTION_OPEN_DIRECTORY.id) {
attrFilter = AttrFilter.dirs;
if (showHiddenFiles)
attrFilter |= AttrFilter.hidden;
}
try {
_entries = listDirectory(dir, attrFilter, selectedFilter());
} catch(Exception e) {