Commit: 2412e67ef860412d814d2fff505ac2f39eb80326
Author: Bastien Montagne
Date:   Wed Dec 28 15:07:18 2016 +0100
Branches: master
https://developer.blender.org/rB2412e67ef860412d814d2fff505ac2f39eb80326

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

Patch D2420 by @raa, thanks.

===================================================================

M       source/blender/editors/interface/interface_layout.c

===================================================================

diff --git a/source/blender/editors/interface/interface_layout.c 
b/source/blender/editors/interface/interface_layout.c
index 80d091c..940e982 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -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;
                }
        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to