diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-27 11:38:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-27 11:42:11 +0400 |
commit | a71f072f9ccaae043069df1cbf95c169a60e494e (patch) | |
tree | 6e24b45d6dbeff8f6a3774373aeb0171a37fd55a /release/scripts/startup/bl_ui/space_node.py | |
parent | 8f2eec5a15b5f26bfbe73382677add202adc89a9 (diff) |
UI: Replace +/- menus with collapsible ones
Patch D160, by Scott Petrovic with own modifications.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_node.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 3bf2977d778..a91c9a31769 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -36,11 +36,7 @@ class NODE_HT_header(Header): row = layout.row(align=True) row.template_header() - if context.area.show_menus: - row.menu("NODE_MT_view") - row.menu("NODE_MT_select") - row.menu("NODE_MT_add") - row.menu("NODE_MT_node") + NODE_MT_editor_menus.draw_collapsible(context, layout) layout.prop(snode, "tree_type", text="", expand=True) @@ -115,6 +111,21 @@ class NODE_HT_header(Header): layout.template_running_jobs() +class NODE_MT_editor_menus(Menu): + bl_idname = "NODE_MT_editor_menus" + bl_label = "" + + def draw(self, context): + self.draw_menus(self.layout, context) + + @staticmethod + def draw_menus(layout, context): + layout.menu("NODE_MT_view") + layout.menu("NODE_MT_select") + layout.menu("NODE_MT_add") + layout.menu("NODE_MT_node") + + class NODE_MT_add(bpy.types.Menu): bl_space_type = 'NODE_EDITOR' bl_label = "Add" |