diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-10-12 15:28:37 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-10-12 15:28:37 +0400 |
commit | 11f0e35236b9acf972826d65c9569c754920e0c3 (patch) | |
tree | b2acb85ba9c43c6306807e3425bff52a9b3defd8 /source/blender/editors/interface/interface_layout.c | |
parent | 61cceb370064d4064708ee079059d4dfc9737b62 (diff) |
Revert both own r60700 and r60702. API behavior for expanded enums is completly inconsistent, but again, better to do such changes (soft-breaking API) in bulk...
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index d5bcb40d5a4..b453a3b8363 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -503,8 +503,16 @@ 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 *UNUSED(uiname), int h, int icon_only) -{ + const char *uiname, int h, int icon_only) +{ + /* XXX The way this function currently handles uiname parameter is insane and inconsistent with general UI API: + * * uiname is the *enum property* label. + * * when it is NULL or empty, we do not draw *enum items* labels, this doubles the icon_only parameter. + * * we *never* draw (i.e. really use) the enum label uiname, it is just used as a mere flag! + * Unfortunately, fixing this implies an API "soft break", so better to defer it for later... :/ + * --mont29 + */ + uiBut *but; EnumPropertyItem *item, *item_array; const char *name; @@ -512,14 +520,6 @@ 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)); @@ -532,7 +532,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt if (!item->identifier[0]) continue; - name = item->name; + name = (!uiname || uiname[0]) ? item->name : ""; icon = item->icon; value = item->value; itemw = ui_text_icon_width(block->curlayout, icon_only ? "" : name, icon, 0); |