diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-30 10:45:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-30 10:45:09 +0300 |
commit | 5f632f9f6ed901baccf4d44fe0a2d846ccc266af (patch) | |
tree | 4ef1f38fb2d2921aeca6e682241482b34345017c /source/blender/editors/interface/interface_layout.c | |
parent | af13168a3f4ab67b66436a706e7069a8ba208c41 (diff) |
Fix color width regression in 66e24ce35bb37753b8002283a72d55639bb40239
Color buttons were drawing single icon width.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 3437b9ad2ac..64c16e57f56 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -339,11 +339,15 @@ static int ui_text_icon_width_ex(uiLayout *layout, /* When there is no text, always behave as if this is an icon-only button * since it's not useful to return empty space. */ - if (!name[0]) { + if (icon && !name[0]) { return unit_x * (1.0f + pad_factor->icon_only); } if (ui_layout_variable_size(layout)) { + if (!icon && !name[0]) { + return unit_x * (1.0f + pad_factor->icon_only); + } + if (layout->alignment != UI_LAYOUT_ALIGN_EXPAND) { layout->item.flag |= UI_ITEM_FIXED_SIZE; } |