Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hammond <doughammond@hamsterfight.co.uk>2011-03-03 01:17:09 +0300
committerDoug Hammond <doughammond@hamsterfight.co.uk>2011-03-03 01:17:09 +0300
commit96247bdb6cb4c9b39f04d57cb8d050782b538ac4 (patch)
treeffd55336664b82218fbbca19d5545df06c2dd5a8 /modules
parent08bb21115df740aec8ee1c9fdf26b29585540f72 (diff)
extensions_framework: minor adjustments to ui; add layout.menu() and make text/icon args optional
Diffstat (limited to 'modules')
-rw-r--r--modules/extensions_framework/ui.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/modules/extensions_framework/ui.py b/modules/extensions_framework/ui.py
index 94aafa03..598839b0 100644
--- a/modules/extensions_framework/ui.py
+++ b/modules/extensions_framework/ui.py
@@ -240,10 +240,22 @@ class property_group_renderer(bpy.types.Panel):
else True,
)
elif current_property['type'] in ['operator']:
- layout.operator(current_property['operator'],
- text = current_property['text'],
- icon = current_property['icon']
- )
+ args = {}
+ for optional_arg in ('text', 'icon'):
+ if optional_arg in current_property_keys:
+ args.update({
+ optional_arg: current_property[optional_arg],
+ })
+ layout.operator( current_property['operator'], **args )
+
+ elif current_property['type'] in ['menu']:
+ args = {}
+ for optional_arg in ('text', 'icon'):
+ if optional_arg in current_property_keys:
+ args.update({
+ optional_arg: current_property[optional_arg],
+ })
+ layout.menu(current_property['menu'], **args)
elif current_property['type'] in ['text']:
layout.label(