diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-06 20:03:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-06 21:57:47 +0300 |
commit | 8a8b549e56c6d2b7fd02e7e58205e0559dfca389 (patch) | |
tree | 3b89a8c3b4eb168fda0d50b58efe631020420ffd /source | |
parent | bd53c053f35be5c5fb92f9208a42edfc636bcaba (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 { |