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_widgets.c | |
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_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 466deedf3bb..a1534ab4b7f 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2263,7 +2263,10 @@ static void widget_draw_extra_icons(const uiWidgetColors *wcol, temp.xmin = temp.xmax - icon_size; - if (!op_icon->highlighted) { + if (op_icon->disabled) { + alpha_this *= 0.4f; + } + else if (!op_icon->highlighted) { alpha_this *= 0.75f; } |