Followup to own r60700, fix was not correct... In fact, beahivor of expanded enums...
authorBastien Montagne <montagne29@wanadoo.fr>
Sat, 12 Oct 2013 11:03:32 +0000 (11:03 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Sat, 12 Oct 2013 11:03:32 +0000 (11:03 +0000)
Thanks to DingTo and plasmasolutions for notifying the issue.

source/blender/editors/interface/interface_layout.c

index 039556811d10dce50cb65132d019af2aeb9987af..d5bcb40d5a4ff9013a486f2384e05176a33f798f 100644 (file)
@@ -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);