Fix: Fullscreen File Browser showing override warning on file open
Steps to reproduce were: * Change File Browser display mode to fullscreen in Preferences * File > Save As (make sure existing .blend is selected) * File > Open The file name would still be shown in red and the + and - icons would be visible, which should only be the case for saving files, not opening. Note that this change makes all `FileSelectParams.flag` values be reset on re-opening a File Browser, which *may* in fact cause other issues. It's easy to fix those though, and I'd prefer properly resetting the flags and only keeping specific ones in that case.
This commit is contained in:
@@ -160,14 +160,11 @@ short ED_fileselect_set_params(SpaceFile *sfile)
|
|||||||
BLI_path_abs(params->dir, blendfile_path);
|
BLI_path_abs(params->dir, blendfile_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params->flag = 0;
|
||||||
if (is_directory == true && is_filename == false && is_filepath == false &&
|
if (is_directory == true && is_filename == false && is_filepath == false &&
|
||||||
is_files == false) {
|
is_files == false) {
|
||||||
params->flag |= FILE_DIRSEL_ONLY;
|
params->flag |= FILE_DIRSEL_ONLY;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
params->flag &= ~FILE_DIRSEL_ONLY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((prop = RNA_struct_find_property(op->ptr, "check_existing"))) {
|
if ((prop = RNA_struct_find_property(op->ptr, "check_existing"))) {
|
||||||
params->flag |= RNA_property_boolean_get(op->ptr, prop) ? FILE_CHECK_EXISTING : 0;
|
params->flag |= RNA_property_boolean_get(op->ptr, prop) ? FILE_CHECK_EXISTING : 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user