diff options
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 32 |
3 files changed, 5 insertions, 31 deletions
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 701c28abfa2..96a9828236a 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -109,8 +109,6 @@ void file_sfile_to_operator_ex(bContext *C, char *filepath); void file_sfile_to_operator(bContext *C, struct wmOperator *op, struct SpaceFile *sfile); -struct ARegion *file_tools_region_ensure(struct ScrArea *sa, struct ARegion *ar_prev); - void file_operator_to_sfile(bContext *C, struct SpaceFile *sfile, struct wmOperator *op); /* filesel.c */ diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index fb8c8c5295d..0224192d559 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -2318,7 +2318,7 @@ void FILE_OT_hidedot(struct wmOperatorType *ot) static int file_bookmark_toggle_exec(bContext *C, wmOperator *UNUSED(unused)) { ScrArea *sa = CTX_wm_area(C); - ARegion *ar = file_tools_region_ensure(sa, BKE_area_find_region_type(sa, RGN_TYPE_UI)); + ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); if (ar) { ED_region_toggle_hidden(C, ar); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index ef7586e9432..d59a75e5e05 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -55,27 +55,6 @@ #include "filelist.h" #include "GPU_framebuffer.h" -static ARegion *file_tools_region_create(ListBase *regionbase, ARegion *ar_prev) -{ - ARegion *ar = MEM_callocN(sizeof(ARegion), "tools region for file"); - BLI_insertlinkafter(regionbase, ar_prev, ar); - ar->regiontype = RGN_TYPE_TOOLS; - ar->alignment = RGN_ALIGN_LEFT; - - return ar; -} - -ARegion *file_tools_region_ensure(ScrArea *sa, ARegion *ar_prev) -{ - ARegion *ar; - - if ((ar = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS)) != NULL) { - return ar; - } - - return file_tools_region_create(&sa->regionbase, ar_prev); -} - static ARegion *file_tools_options_toggle_region_ensure(ScrArea *sa, ARegion *ar_prev) { ARegion *ar; @@ -154,7 +133,10 @@ static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen ar->flag |= RGN_FLAG_DYNAMIC_SIZE; /* Tools region */ - file_tools_region_create(&sfile->regionbase, ar); + ar = MEM_callocN(sizeof(ARegion), "tools region for file"); + BLI_addtail(&sfile->regionbase, ar); + ar->regiontype = RGN_TYPE_TOOLS; + ar->alignment = RGN_ALIGN_LEFT; /* Options toggle, tool props and execute region are added as needed, see file_refresh(). */ @@ -276,18 +258,12 @@ static void file_ensure_valid_region_state(bContext *C, SpaceFile *sfile, FileSelectParams *params) { - ARegion *ar_ui = BKE_area_find_region_type(sa, RGN_TYPE_UI); ARegion *ar_tools_upper = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); ARegion *ar_props = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS); ARegion *ar_execute = BKE_area_find_region_type(sa, RGN_TYPE_EXECUTE); ARegion *ar_tools_lower; bool needs_init = false; /* To avoid multiple ED_area_initialize() calls. */ - if (ar_tools_upper == NULL) { - ar_tools_upper = file_tools_region_ensure(sa, ar_ui); - needs_init = true; - } - /* If there's an file-operation, ensure we have the option and execute region */ if (sfile->op && (ar_props == NULL)) { ar_tools_lower = file_tools_options_toggle_region_ensure(sa, ar_tools_upper); |