show a title in menus triggered by WM_OT_context_menu_enum, also show an icon when available.

This commit is contained in:
Campbell Barton
2013-01-17 00:29:39 +00:00
parent 6891c57e4c
commit c8df3db370
2 changed files with 17 additions and 0 deletions

View File

@@ -505,6 +505,10 @@ class WM_MT_context_menu_enum(Menu):
return {'PASS_THROUGH'}
base_path, prop_string = data_path.rsplit(".", 1)
value_base = context_path_validate(context, base_path)
prop = value_base.bl_rna.properties[prop_string]
layout = self.layout
layout.label(prop.name, icon=prop.icon)
col = self.layout.column()
col.prop(value_base, prop_string, expand=True)