From a71f072f9ccaae043069df1cbf95c169a60e494e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Jan 2014 18:38:53 +1100 Subject: UI: Replace +/- menus with collapsible ones Patch D160, by Scott Petrovic with own modifications. --- release/scripts/startup/bl_ui/space_graph.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'release/scripts/startup/bl_ui/space_graph.py') diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 61e2f10a057..775f398bc78 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -35,12 +35,7 @@ class GRAPH_HT_header(Header): row = layout.row(align=True) row.template_header() - if context.area.show_menus: - row.menu("GRAPH_MT_view") - row.menu("GRAPH_MT_select") - row.menu("GRAPH_MT_marker") - row.menu("GRAPH_MT_channel") - row.menu("GRAPH_MT_key") + GRAPH_MT_editor_menus.draw_collapsible(context, layout) layout.prop(st, "mode", text="") @@ -65,6 +60,22 @@ class GRAPH_HT_header(Header): row.operator("graph.ghost_curves_create", text="", icon='GHOST_ENABLED') +class GRAPH_MT_editor_menus(Menu): + bl_idname = "GRAPH_MT_editor_menus" + bl_label = "" + + def draw(self, context): + self.draw_menus(self.layout, context) + + @staticmethod + def draw_menus(layout, context): + layout.menu("GRAPH_MT_view") + layout.menu("GRAPH_MT_select") + layout.menu("GRAPH_MT_marker") + layout.menu("GRAPH_MT_channel") + layout.menu("GRAPH_MT_key") + + class GRAPH_MT_view(Menu): bl_label = "View" -- cgit v1.2.3