Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_widgets.c
| Show First 20 Lines • Show All 1,414 Lines • ▼ Show 20 Lines | if (icon && icon != ICON_BLANK1) { | ||||
| } | } | ||||
| /* Get theme color. */ | /* Get theme color. */ | ||||
| uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]}; | uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]}; | ||||
| const bool has_theme = UI_icon_get_theme_color(icon, color); | const bool has_theme = UI_icon_get_theme_color(icon, color); | ||||
| /* to indicate draggable */ | /* to indicate draggable */ | ||||
| if (ui_but_drag_is_draggable(but) && (but->flag & UI_ACTIVE)) { | if (ui_but_drag_is_draggable(but) && (but->flag & UI_ACTIVE)) { | ||||
| UI_icon_draw_ex(xs, ys, icon, aspect, 1.25f, 0.0f, color, has_theme); | UI_icon_draw_ex( | ||||
| xs, ys, icon, aspect, 1.25f, 0.0f, color, has_theme, &but->icon_overlay_text); | |||||
| } | } | ||||
| else if (but->flag & (UI_ACTIVE | UI_SELECT | UI_SELECT_DRAW)) { | else if (but->flag & (UI_ACTIVE | UI_SELECT | UI_SELECT_DRAW)) { | ||||
| UI_icon_draw_ex(xs, ys, icon, aspect, alpha, 0.0f, color, has_theme); | UI_icon_draw_ex( | ||||
| xs, ys, icon, aspect, alpha, 0.0f, color, has_theme, &but->icon_overlay_text); | |||||
| } | } | ||||
| else if (!((but->icon != ICON_NONE) && UI_but_is_tool(but))) { | else if (!((but->icon != ICON_NONE) && UI_but_is_tool(but))) { | ||||
| if (has_theme) { | if (has_theme) { | ||||
| alpha *= 0.8f; | alpha *= 0.8f; | ||||
| } | } | ||||
| UI_icon_draw_ex(xs, ys, icon, aspect, alpha, 0.0f, color, has_theme); | UI_icon_draw_ex( | ||||
| xs, ys, icon, aspect, alpha, 0.0f, color, has_theme, &but->icon_overlay_text); | |||||
| } | } | ||||
| else { | else { | ||||
| const bTheme *btheme = UI_GetTheme(); | const bTheme *btheme = UI_GetTheme(); | ||||
| const float desaturate = 1.0 - btheme->tui.icon_saturation; | const float desaturate = 1.0 - btheme->tui.icon_saturation; | ||||
| UI_icon_draw_ex(xs, ys, icon, aspect, alpha, desaturate, color, has_theme); | UI_icon_draw_ex( | ||||
| xs, ys, icon, aspect, alpha, desaturate, color, has_theme, &but->icon_overlay_text); | |||||
| } | } | ||||
| } | } | ||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| static void widget_draw_submenu_tria(const uiBut *but, | static void widget_draw_submenu_tria(const uiBut *but, | ||||
| const rcti *rect, | const rcti *rect, | ||||
| ▲ Show 20 Lines • Show All 3,975 Lines • ▼ Show 20 Lines | if (iconid) { | ||||
| const int xs = rect->xmin + 0.2f * UI_UNIT_X; | const int xs = rect->xmin + 0.2f * UI_UNIT_X; | ||||
| const int ys = rect->ymin + 0.1f * BLI_rcti_size_y(rect); | const int ys = rect->ymin + 0.1f * BLI_rcti_size_y(rect); | ||||
| height = ICON_SIZE_FROM_BUTRECT(rect); | height = ICON_SIZE_FROM_BUTRECT(rect); | ||||
| aspect = ICON_DEFAULT_HEIGHT / height; | aspect = ICON_DEFAULT_HEIGHT / height; | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| /* XXX scale weak get from fstyle? */ | /* XXX scale weak get from fstyle? */ | ||||
| UI_icon_draw_ex(xs, ys, iconid, aspect, 1.0f, 0.0f, wt->wcol.text, false); | UI_icon_draw_ex( | ||||
| xs, ys, iconid, aspect, 1.0f, 0.0f, wt->wcol.text, false, UI_NO_ICON_OVERLAY_TEXT); | |||||
| GPU_blend(GPU_BLEND_NONE); | GPU_blend(GPU_BLEND_NONE); | ||||
| } | } | ||||
| /* part text right aligned */ | /* part text right aligned */ | ||||
| if (separator_type != UI_MENU_ITEM_SEPARATOR_NONE) { | if (separator_type != UI_MENU_ITEM_SEPARATOR_NONE) { | ||||
| if (cpoin) { | if (cpoin) { | ||||
| /* State info for the hint drawing. */ | /* State info for the hint drawing. */ | ||||
| uiWidgetStateInfo hint_state = state; | uiWidgetStateInfo hint_state = state; | ||||
| ▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines | |||||