diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-08-18 12:18:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-08-18 12:18:16 +0300 |
commit | 3a8e73943e18c9df58381c744af020d69948f1e2 (patch) | |
tree | 5484a3c20940971f196c78e920ec87a107e21586 | |
parent | 1190da3ad96ed51a9517574649b41cafc7dc1a84 (diff) |
Fix T45824: Pie's no longer show enum icons
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index f70e30c1f05..efa358fa1a7 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1246,7 +1246,10 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index } /* menus and pie-menus don't show checkbox without this */ - if (ELEM(layout->root->type, UI_LAYOUT_MENU, UI_LAYOUT_PIEMENU)) { + if ((layout->root->type == UI_LAYOUT_MENU) || + /* use checkboxes only as a fallback in pie-menu's, when no icon is defined */ + ((layout->root->type == UI_LAYOUT_PIEMENU) && (icon == ICON_NONE))) + { if (type == PROP_BOOLEAN && ((is_array == false) || (index != RNA_NO_INDEX))) { if (is_array) icon = (RNA_property_boolean_get_index(ptr, prop, index)) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT; else icon = (RNA_property_boolean_get(ptr, prop)) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT; @@ -1266,7 +1269,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index toggle = (flag & UI_ITEM_R_TOGGLE) != 0; expand = (flag & UI_ITEM_R_EXPAND) != 0; icon_only = (flag & UI_ITEM_R_ICON_ONLY) != 0; - no_bg = (flag & UI_ITEM_R_NO_BG); + no_bg = (flag & UI_ITEM_R_NO_BG) != 0; /* get size */ ui_item_rna_size(layout, name, icon, ptr, prop, index, icon_only, &w, &h); @@ -1431,7 +1434,7 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, const char *propname for (i = 0; i < totitem; i++) { if (item[i].identifier[0]) { - uiItemEnumR_prop(column, item[i].name, ICON_NONE, ptr, prop, item[i].value); + uiItemEnumR_prop(column, item[i].name, item[i].icon, ptr, prop, item[i].value); ui_but_tip_from_enum_item(block->buttons.last, &item[i]); } else { |