[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60702] trunk/blender/source/blender/ editors/interface/interface_layout.c: Followup to own r60700, fix was not correct...

Bastien Montagne montagne29 at wanadoo.fr
Sat Oct 12 13:03:33 CEST 2013


Revision: 60702
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60702
Author:   mont29
Date:     2013-10-12 11:03:32 +0000 (Sat, 12 Oct 2013)
Log Message:
-----------
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.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60700

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_layout.c

Modified: trunk/blender/source/blender/editors/interface/interface_layout.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_layout.c	2013-10-12 09:54:57 UTC (rev 60701)
+++ trunk/blender/source/blender/editors/interface/interface_layout.c	2013-10-12 11:03:32 UTC (rev 60702)
@@ -503,7 +503,7 @@
 	}
 }
 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 @@
 
 	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 @@
 		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);




More information about the Bf-blender-cvs mailing list