diff --git a/src/config/mod.rs b/src/config/mod.rs index 1f1d7db2..58ad044c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -250,7 +250,7 @@ impl Default for FileDialogConfig { show_menu_button: true, show_reload_button: true, show_hidden_option: true, - show_system_files_option: true, + show_system_files_option: SHOW_SYSTEM_FILES_OPTION_DEFAULT, show_search: true, show_left_panel: true, @@ -262,6 +262,13 @@ impl Default for FileDialogConfig { } } +/// On Windows, displaying system files is troublesome, the option should only +/// be enabled on explicit request. +#[cfg(windows)] +const SHOW_SYSTEM_FILES_OPTION_DEFAULT: bool = false; +#[cfg(not(windows))] +const SHOW_SYSTEM_FILES_OPTION_DEFAULT: bool = true; + impl FileDialogConfig { /// Sets the storage used by the file dialog. /// Storage includes all data that is persistently stored between multiple