Fix T85448: File Browser sidebar collapses when selecting a file

The logic to ensure a valid region state was too aggressive in setting the
region hiding. It would just always update it based on the operator's
`hide_props_region` option, not only when file browser was newly opened.
It's more selective now.
This commit is contained in:
Julian Eisel 2021-02-08 16:09:35 +01:00
parent 302625eb37
commit 048135e2c8
Notes: blender-bot 2023-02-14 11:21:43 +01:00
Referenced by issue #85448, Side panel on the right side of file browser always closes after clicking on a file.
1 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ static void file_ensure_valid_region_state(bContext *C,
}
}
/* If there's an file-operation, ensure we have the option and execute region */
else if (sfile->op) {
else if (sfile->op && !BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS)) {
ARegion *region_ui = file_ui_region_ensure(area, region_tools);
ARegion *region_execute = file_execute_region_ensure(area, region_ui);
ARegion *region_props = file_tool_props_region_ensure(area, region_execute);
@ -276,7 +276,7 @@ static void file_ensure_valid_region_state(bContext *C,
needs_init = true;
}
/* If there's _no_ file-operation, ensure we _don't_ have the option and execute region */
else {
else if (!sfile->op) {
ARegion *region_props = BKE_area_find_region_type(area, RGN_TYPE_TOOL_PROPS);
ARegion *region_execute = BKE_area_find_region_type(area, RGN_TYPE_EXECUTE);
ARegion *region_ui = file_ui_region_ensure(area, region_tools);