diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-10-12 15:03:32 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-10-12 15:03:32 +0400 |
commit | c7109b152eaf3c9e216fe5304a3f5daf55135da9 (patch) | |
tree | 6fe78fd206dd6b51ba5abb51f159d58536861f72 /source/blender/editors/interface/interface_layout.c | |
parent | c0295bd3d371aef517eda2a5909430e76edec1fc (diff) |
Followup to own r60700, fix was not correct... In fact, beahivor of expanded enums is not consistent with other properties, as there labels are never shown. Keep it for now, though, as this would break many scripts and ui file, better to do this in bulk!
Thanks to DingTo and plasmasolutions for notifying the issue.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 039556811d1..d5bcb40d5a4 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -503,7 +503,7 @@ static void ui_item_enum_expand_handle(bContext *C, void *arg1, void *arg2) } } static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, - const char *uiname, int h, int icon_only) + const char *UNUSED(uiname), int h, int icon_only) { uiBut *but; EnumPropertyItem *item, *item_array; @@ -512,6 +512,14 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item_array, NULL, &free); +#if 0 /* XXX This would be consistent with general uiItemR (i.e. layout.prop() in py) behavior. + * However, so far we never ever shown the label of an expanded enum prop, so for now disable this. + */ + if (uiname && uiname[0]) { + uiItemL(layout, uiname, ICON_NONE); + } +#endif + /* we dont want nested rows, cols in menus */ if (layout->root->type != UI_LAYOUT_MENU) { uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1)); @@ -524,7 +532,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt if (!item->identifier[0]) continue; - name = uiname ? uiname : item->name; + name = item->name; icon = item->icon; value = item->value; itemw = ui_text_icon_width(block->curlayout, icon_only ? "" : name, icon, 0); |