Adds an argument to draw only icons in operator_enum menus. This is useful for drawing inline icons in the outliner context menu for collection color tagging.
Details
- Reviewers
Julian Eisel (Severin) - Maniphest Tasks
- T77408: Continued Outliner Improvements Design
- Commits
- rB93b8040f5729: UI: Add `icon_only` argument to operator_enum
Diff Detail
- Repository
- rB Blender
Event Timeline
Usually we convert the BPY options like icon_only into flags right in RNA. So rather than calling uiItemsEnumO() directly, there could be a rna_uiItemsEnumO() that does this + additional sanity checks. See uiItemO() and rna_uiItemO(). I would do this for the sake of consistency.
Also see my last comment in D8317. Other than that, this patch is ready I think.
| source/blender/editors/interface/interface_layout.c | ||
|---|---|---|
| 1524 | split may be used uninitialized here. I think just NULL-checking is fine. | |
| source/blender/makesrna/intern/rna_ui_api.c | ||
|---|---|---|
| 354–358 | Ah sorry, I just noticed that uiItemsFullEnumO() (called by uiItemsEnumO()) already does these sanity checks. | |
Ah sorry, I just noticed that uiItemsFullEnumO() (called by uiItemsEnumO()) already does these sanity checks.
I should have looked a bit deeper rather than blindly trusting your suggestions :)