From 8a8b549e56c6d2b7fd02e7e58205e0559dfca389 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 7 Dec 2019 04:03:02 +1100 Subject: UI: only use toolbar draw-style for buttons with icons This allows tool buttons to be used in menus or popovers and show as regular button styles. --- source/blender/editors/interface/interface_widgets.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/interface/interface_widgets.c') diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index f2027d491fb..9e0d34e386d 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1609,7 +1609,7 @@ static void widget_draw_icon( 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); } - else if (!UI_but_is_tool(but)) { + else if (!((but->icon != ICON_NONE) && UI_but_is_tool(but))) { if (has_theme) { alpha *= 0.8f; } @@ -2459,7 +2459,7 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle, } /* Icons on the left with optional text label on the right */ else if (but->flag & UI_HAS_ICON || show_menu_icon) { - const bool is_tool = UI_but_is_tool(but); + const bool is_tool = ((but->icon != ICON_NONE) & UI_but_is_tool(but)); /* XXX add way to draw icons at a different size! * Use small icons for popup. */ @@ -4626,7 +4626,7 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct case UI_BTYPE_BUT: #ifdef USE_UI_TOOLBAR_HACK - if (UI_but_is_tool(but)) { + if ((but->icon != ICON_NONE) && UI_but_is_tool(but)) { wt = widget_type(UI_WTYPE_TOOLBAR_ITEM); } else { -- cgit v1.2.3