remove TRANSFORM_OT_snap_type, use WM_OT_context_menu_enum instead.

add Ctrl+Shift+Tab shortcut for selecting snap type to the UV editor too.

also added icon drawing to WM_OT_context_menu_enum() so it gets the icons from the enum to draw them in the menu.
This commit is contained in:
Campbell Barton
2013-01-13 16:18:35 +00:00
parent 4f938bbbfe
commit 4f2a65d34c
3 changed files with 21 additions and 38 deletions

View File

@@ -506,10 +506,10 @@ class WM_MT_context_menu_enum(Menu):
base_path, prop_string = data_path.rsplit(".", 1)
value_base = context_path_validate(context, base_path)
values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].enum_items]
values = [(i.name, i.identifier, i.icon) for i in value_base.bl_rna.properties[prop_string].enum_items]
for name, identifier in values:
props = self.layout.operator("wm.context_set_enum", text=name)
for name, identifier, icon in values:
props = self.layout.operator("wm.context_set_enum", text=name, icon=icon)
props.data_path = data_path
props.value = identifier