Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-10-08 17:17:29 +0300
committerJulian Eisel <julian@blender.org>2021-10-08 17:31:16 +0300
commitff57ce86170d2e440d2e0566bf3c4a74bb745b32 (patch)
tree9f134c05c3d3fc77a9fe3b6a089c6b84b33f264e /source/blender/editors/interface/interface_widgets.c
parent38c4888f0999ee5361dc76d2b9a7cd45e8ae2896 (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.c5
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;
}