diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-11-07 18:09:54 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-11-07 18:09:54 +0300 |
commit | b6b888f7fb706487d9e5ae6b0738201da5493b9f (patch) | |
tree | 852f79b4532a1b93e75c2541ca0d181b00de08a2 /source/blender/editors/space_file/file_ops.c | |
parent | a2377b60548f2fe5d46b14ecdf4cf83971432b5c (diff) | |
parent | 95631c94c4bd08f8a7e9c713f624e934eb7eb7ae (diff) |
Merge branch 'master' into gpencil-new-data-proposalgpencil-new-data-proposal
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index f68d329329f..6d7365fa136 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1309,6 +1309,18 @@ static int bookmark_move_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static bool file_bookmark_move_poll(bContext *C) +{ + SpaceFile *sfile = CTX_wm_space_file(C); + + /* Bookmarks are for file browsing only (not asset browsing). */ + if (!ED_operator_file_browsing_active(C)) { + return false; + } + + return sfile->bookmarknr != -1; +} + void FILE_OT_bookmark_move(wmOperatorType *ot) { static const EnumPropertyItem slot_move[] = { @@ -1325,8 +1337,7 @@ void FILE_OT_bookmark_move(wmOperatorType *ot) /* api callbacks */ ot->exec = bookmark_move_exec; - /* Bookmarks are for file browsing only (not asset browsing). */ - ot->poll = ED_operator_file_browsing_active; + ot->poll = file_bookmark_move_poll; /* flags */ ot->flag = OPTYPE_REGISTER; /* No undo! */ |