Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 2,247 Lines • ▼ Show 20 Lines | UI_fontstyle_draw(fstyle, | ||||
| &(struct uiFontStyleDraw_Params){ | &(struct uiFontStyleDraw_Params){ | ||||
| .align = UI_STYLE_TEXT_RIGHT, | .align = UI_STYLE_TEXT_RIGHT, | ||||
| }); | }); | ||||
| } | } | ||||
| } | } | ||||
| static void widget_draw_extra_icons(const uiWidgetColors *wcol, | static void widget_draw_extra_icons(const uiWidgetColors *wcol, | ||||
| uiBut *but, | uiBut *but, | ||||
| rcti *rect, | rcti *UNUSED(rect), | ||||
vvv: Not sure what is it for, but it's unavailable in `ui_but_extra_operator_icon_mouse_over_get`… | |||||
| float alpha) | float alpha) | ||||
| { | { | ||||
| /* WARNING: Icon rect calculation should be in sync with | |||||
| * ui_but_extra_operator_icon_mouse_over_get. */ | |||||
| rcti icon_rect; | |||||
| BLI_rcti_rctf_copy_round(&icon_rect, &but->rect); | |||||
| const int icon_size = (0.8f * BLI_rcti_size_y(&icon_rect)); /* ICON_SIZE_FROM_BUTRECT */ | |||||
vvvAuthorUnsubmitted Done Inline ActionsIn the worst case, if the macro gets changed, at least we stay in sync with ui_but_extra_operator_icon_mouse_over_get. Can't use ICON_SIZE_FROM_BUTRECT in interface_handlers.c, so not using here. vvv: In the worst case, if the macro gets changed, at least we stay in sync with… | |||||
| /* inverse order, from right to left. */ | /* inverse order, from right to left. */ | ||||
| LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) { | LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) { | ||||
| rcti temp = *rect; | icon_rect.xmin = icon_rect.xmax - BLI_rcti_size_y(&icon_rect); | ||||
| float alpha_this = alpha; | |||||
| temp.xmin = temp.xmax - (BLI_rcti_size_y(rect) * 1.08f); | |||||
| if (!op_icon->highlighted) { | float alpha_this = op_icon->highlighted ? alpha : alpha * 0.25f; // 0.75f | ||||
| alpha_this *= 0.75f; | |||||
| } | |||||
| widget_draw_icon(but, op_icon->icon, alpha_this, &temp, wcol->text); | widget_draw_icon(but, op_icon->icon, alpha_this, &icon_rect, wcol->text); | ||||
| rect->xmax -= ICON_SIZE_FROM_BUTRECT(rect); | icon_rect.xmax -= icon_size; | ||||
| } | } | ||||
| } | } | ||||
| static void widget_draw_node_link_socket(const uiWidgetColors *wcol, | static void widget_draw_node_link_socket(const uiWidgetColors *wcol, | ||||
| const rcti *rect, | const rcti *rect, | ||||
| uiBut *but, | uiBut *but, | ||||
| float alpha) | float alpha) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 3,095 Lines • Show Last 20 Lines | |||||
Not sure what is it for, but it's unavailable in ui_but_extra_operator_icon_mouse_over_get, so not using here either.