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
This commit is contained in:
Aleksandr Zinovev
2017-08-12 11:00:19 +03:00
parent ccb8e78d6c
commit b5cd89bab9

View File

@@ -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);