diff options
author | Julian Eisel <julian@blender.org> | 2021-10-08 17:17:29 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-08 17:31:16 +0300 |
commit | ff57ce86170d2e440d2e0566bf3c4a74bb745b32 (patch) | |
tree | 9f134c05c3d3fc77a9fe3b6a089c6b84b33f264e /source/blender/editors/interface/interface_intern.h | |
parent | 38c4888f0999ee5361dc76d2b9a7cd45e8ae2896 (diff) |
UI: Support showing superimposed icons as disabled (with disabled hint)
If the operator poll of a superimposed icon returned `false`, the
superimposed icon would just draw normally and fail silently. Instead it
will now be drawn grayed out, plus the tooltip of the icon can show the
usual "disabled hint" (a hint explaining why the button is disabled).
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 5c06f8cfd13..e7a728efce1 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -407,6 +407,7 @@ typedef struct uiButExtraOpIcon { struct wmOperatorCallParams *optype_params; bool highlighted; + bool disabled; } uiButExtraOpIcon; typedef struct ColorPicker { @@ -694,6 +695,9 @@ void ui_but_range_set_hard(uiBut *but); void ui_but_range_set_soft(uiBut *but); bool ui_but_context_poll_operator(struct bContext *C, struct wmOperatorType *ot, const uiBut *but); +bool ui_but_context_poll_operator_ex(struct bContext *C, + const uiBut *but, + const struct wmOperatorCallParams *optype_params); extern void ui_but_update(uiBut *but); extern void ui_but_update_edited(uiBut *but); |