diff options
author | Aleksandr Zinovev <roaoao@gmail.com> | 2017-08-12 11:00:19 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-17 15:07:19 +0300 |
commit | 686b8e8fedde898375382fdc0a4596c222752feb (patch) | |
tree | d0903a82e155f024e0b7f6ae47acc1f0740ab1a8 /source | |
parent | 0aae2087497a8bd814b813f6191c6689f9dd4432 (diff) |
Fix width estimation for buttons with short labels in pie menus
Differential Revision: https://developer.blender.org/D2781
To be backported to 2.79 branch
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index b4de3d0c5ef..a95fe59348d 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -3406,8 +3406,9 @@ void ui_layout_add_but(uiLayout *layout, uiBut *but) ui_item_size((uiItem *)bitem, &w, &h); /* XXX uiBut hasn't scaled yet * we can flag the button as not expandable, depending on its size */ - if (w <= 2 * UI_UNIT_X) + if (w <= 2 * UI_UNIT_X && (!but->str || but->str[0] == '\0')) { bitem->item.flag |= UI_ITEM_MIN; + } BLI_addtail(&layout->items, bitem); |