UI: Tooltip when bone collections are linked

Linked bone collections are disabled in b79419914a
Include 'Disabled' tooltip for `move and assign to collection`
operation when bcol are linked.
In poll functions all other cases are already handled and also not
possible to get the index of hovered collection so just include
`poll_msg_set` in the end.

Pull Request: https://projects.blender.org/blender/blender/pulls/117715
This commit is contained in:
Pratik Borhade
2024-02-04 07:01:05 +01:00
committed by Pratik Borhade
parent faeab05395
commit 3566a9e8de

View File

@@ -419,6 +419,8 @@ static bool bone_collection_assign_poll(bContext *C)
return false;
}
CTX_wm_operator_poll_msg_set(C, "Linked bone collections are not editable");
/* The target bone collection can be specified by name in an operator property, but that's not
* available here. So just allow in the poll function, and do the final check in the execute. */
return true;
@@ -1004,6 +1006,8 @@ static bool move_to_collection_poll(bContext *C)
return false;
}
CTX_wm_operator_poll_msg_set(C, "Linked bone collections are not editable");
/* Ideally this would also check the target bone collection to move/assign to.
* However, that requires access to the operator properties, and those are not
* available in the poll function. */
@@ -1134,7 +1138,6 @@ static void move_to_collection_menu_create(bContext *C, uiLayout *layout, void *
uiLayout *sub = uiLayoutRow(layout, false);
uiLayoutSetEnabled(sub, false);
/* TODO: figure out if we can add a 'disabled' message in the tooltip. */
menu_add_item_for_move_assign_unassign(sub, arm, bcoll, index, is_move_operation);
continue;
}