diff options
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_intern.h | 5 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.h | 5 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.h | 5 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 8 |
7 files changed, 26 insertions, 19 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 68e9f76abc5..083d41747b3 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -875,7 +875,9 @@ void file_draw_list(const bContext *C, ARegion *region) sfile->files, file, FILE_SEL_REMOVE, FILE_SEL_EDITING, CHECK_ALL); } } - else { + + /* file_selflag might have been modified by branch above. */ + if ((file_selflag & FILE_SEL_EDITING) == 0) { const int txpos = (params->display == FILE_IMGDISPLAY) ? sx : sx + 1 + icon_ofs; const int typos = (params->display == FILE_IMGDISPLAY) ? sy - layout->tile_h + layout->textheight : diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index b7e8d35ffee..44131693628 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -21,8 +21,7 @@ * \ingroup spfile */ -#ifndef __FILE_INTERN_H__ -#define __FILE_INTERN_H__ +#pragma once /* internal exports only */ @@ -116,5 +115,3 @@ void file_execute_region_panels_register(struct ARegionType *art); /* file_utils.c */ void file_tile_boundbox(const ARegion *region, FileLayout *layout, const int file, rcti *r_bounds); - -#endif /* __FILE_INTERN_H__ */ diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 45e45093238..e9ffd4583d7 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -518,7 +518,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, const wmEvent *event) rect.ymin = rect.ymax = event->mval[1]; if (!ED_fileselect_layout_is_inside_pt(sfile->layout, ®ion->v2d, rect.xmin, rect.ymin)) { - return OPERATOR_CANCELLED; + return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } if (sfile && sfile->params) { @@ -1697,6 +1697,19 @@ static int file_exec(bContext *C, wmOperator *exec_op) return OPERATOR_FINISHED; } +static int file_exec_invoke(bContext *C, wmOperator *op, const wmEvent *event) +{ + ARegion *region = CTX_wm_region(C); + SpaceFile *sfile = CTX_wm_space_file(C); + + if (!ED_fileselect_layout_is_inside_pt( + sfile->layout, ®ion->v2d, event->mval[0], event->mval[1])) { + return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; + } + + return file_exec(C, op); +} + void FILE_OT_execute(struct wmOperatorType *ot) { PropertyRNA *prop; @@ -1707,6 +1720,7 @@ void FILE_OT_execute(struct wmOperatorType *ot) ot->idname = "FILE_OT_execute"; /* api callbacks */ + ot->invoke = file_exec_invoke; ot->exec = file_exec; ot->poll = file_operator_poll; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 3ce80c11160..67ea22a7ef5 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -2212,7 +2212,7 @@ static bool file_is_blend_backup(const char *str) } } - return (retval); + return retval; } /* TODO: Maybe we should move this to BLI? diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index e90a8659417..53937e7a743 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -21,8 +21,7 @@ * \ingroup spfile */ -#ifndef __FILELIST_H__ -#define __FILELIST_H__ +#pragma once #ifdef __cplusplus extern "C" { @@ -139,5 +138,3 @@ bool filelist_cache_previews_running(struct FileList *filelist); #ifdef __cplusplus } #endif - -#endif diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index 17cfdf1c7f0..c4af27a25aa 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -21,8 +21,7 @@ * \ingroup spfile */ -#ifndef __FSMENU_H__ -#define __FSMENU_H__ +#pragma once /* XXX could become UserPref */ #define FSMENU_RECENT_MAX 10 @@ -76,5 +75,3 @@ void fsmenu_refresh_bookmarks_status(struct wmWindowManager *wm, struct FSMenu * int fsmenu_get_active_indices(struct FSMenu *fsmenu, enum FSMenuCategory category, const char *dir); - -#endif diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 43939b9ff54..f520f91b89b 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -91,7 +91,7 @@ static ARegion *file_tool_props_region_ensure(ScrArea *area, ARegion *region_pre /* ******************** default callbacks for file space ***************** */ -static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scene)) +static SpaceLink *file_create(const ScrArea *UNUSED(area), const Scene *UNUSED(scene)) { ARegion *region; SpaceFile *sfile; @@ -235,7 +235,7 @@ static void file_ensure_valid_region_state(bContext *C, ARegion *region_ui = BKE_area_find_region_type(area, RGN_TYPE_UI); 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); - bool needs_init = false; /* To avoid multiple ED_area_initialize() calls. */ + bool needs_init = false; /* To avoid multiple ED_area_init() calls. */ /* If there's an file-operation, ensure we have the option and execute region */ if (sfile->op && (region_props == NULL)) { @@ -261,7 +261,7 @@ static void file_ensure_valid_region_state(bContext *C, } if (needs_init) { - ED_area_initialize(wm, win, area); + ED_area_init(wm, win, area); } } @@ -693,7 +693,7 @@ void ED_spacetype_file(void) st->spaceid = SPACE_FILE; strncpy(st->name, "File", BKE_ST_MAXNAME); - st->new = file_new; + st->create = file_create; st->free = file_free; st->init = file_init; st->exit = file_exit; |