UI: Make icon-only buttons for enum items with empty label.

Patch D2420 by @raa, thanks.
This commit is contained in:
Bastien Montagne 2016-12-28 15:07:18 +01:00
parent a522469940
commit 2412e67ef8
1 changed files with 2 additions and 1 deletions

View File

@ -1463,8 +1463,9 @@ void uiItemEnumR_string(uiLayout *layout, struct PointerRNA *ptr, const char *pr
for (a = 0; item[a].identifier; a++) {
if (item[a].value == ivalue) {
const char *item_name = name ? name : CTX_IFACE_(RNA_property_translation_context(prop), item[a].name);
const int flag = item_name[0] ? 0 : UI_ITEM_R_ICON_ONLY;
uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, item_name, icon ? icon : item[a].icon);
uiItemFullR(layout, ptr, prop, RNA_ENUM_VALUE, ivalue, flag, item_name, icon ? icon : item[a].icon);
break;
}
}