UI: support operator enums in Quick Favorites #107616

Merged
Philipp Oeser merged 5 commits from lichtwerk/blender:59244 into main 2023-05-08 09:14:52 +02:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit 8ae4fa4436 - Show all commits

View File

@ -609,6 +609,11 @@ bool ED_operator_camera_poll(struct bContext *C);
bUserMenu **ED_screen_user_menus_find(const struct bContext *C, uint *r_len);
struct bUserMenu *ED_screen_user_menu_ensure(struct bContext *C);
/** Finds a menu item associated with an operator in user menus (aka Quick Favorites)
*
* \param op_prop_enum: name of an operator property when the operator is called with an enum (to
* be an empty string otherwise)

Doc-string should note this is to be an empty string when not set.

Doc-string should note this is to be an empty string when not set.

done

done
*/
struct bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(struct ListBase *lb,
const struct wmOperatorType *ot,
struct IDProperty *prop,

View File

@ -235,6 +235,8 @@ static void screen_user_menu_draw(const bContext *C, Menu *menu)
NULL);
}
else {
/* umi_op->prop could be used to set other properties but it's currently unsupported.
*/
uiItemMenuEnumFullO_ptr(menu->layout,
Review

It's possible we want to support assigning additional properties even with op_prop_enum set, although I'm not sure if there are practical cases which would use this of hand.

Nevertheless, it's worth adding a comment that umi_op->prop could be used to set other properties but it's currently unsupported.

It's possible we want to support assigning additional properties even with `op_prop_enum` set, although I'm not sure if there are practical cases which would use this of hand. Nevertheless, it's worth adding a comment that `umi_op->prop` could be used to set other properties but it's currently unsupported.
Review

added that comment

added that comment
C,
ot,