diff options
author | Julian Eisel <julian@blender.org> | 2020-09-18 21:10:40 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-09-18 21:38:45 +0300 |
commit | aacf8d75f5cbf8db5ac6feec7e49eac7c296ad96 (patch) | |
tree | 1df7b52bd70ce8350f6bfd2eb6b5f5f289c4a189 /source/blender/editors/interface/interface_widgets.c | |
parent | a6a0cbcd7492bd8087b6df659c365482614b13e2 (diff) |
UI: Support mouse over highlighting for superimposed icons
E.g. the 'x' icons or eyedropper icons in text buttons. They didn't use
to have any mouse over feedback, now we dim the icon until hovered.
This kind of feedback helps users see that the icons are interactive,
and if they are within their interaction hotspot.
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index c7840aae07a..3d103190a0d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2248,10 +2248,15 @@ static void widget_draw_extra_icons(const uiWidgetColors *wcol, /* inverse order, from right to left. */ LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) { rcti temp = *rect; + float alpha_this = alpha; temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f); - widget_draw_icon(but, op_icon->icon, alpha, &temp, wcol->text); + if (!op_icon->highlighted) { + alpha_this *= 0.75f; + } + + widget_draw_icon(but, op_icon->icon, alpha_this, &temp, wcol->text); rect->xmax -= ICON_SIZE_FROM_BUTRECT(rect); } |