diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_dopesheet.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 9d317033bb9..269c960ee7e 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -107,20 +107,7 @@ class DOPESHEET_HT_header(Header): row = layout.row(align=True) row.template_header() - if context.area.show_menus: - row.menu("DOPESHEET_MT_view") - row.menu("DOPESHEET_MT_select") - row.menu("DOPESHEET_MT_marker") - - if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None): - row.menu("DOPESHEET_MT_channel") - elif st.mode == 'GPENCIL': - row.menu("DOPESHEET_MT_gpencil_channel") - - if st.mode != 'GPENCIL': - row.menu("DOPESHEET_MT_key") - else: - row.menu("DOPESHEET_MT_gpencil_frame") + DOPESHEET_MT_editor_menus.draw_collapsible(context, layout) layout.prop(st, "mode", text="") layout.prop(st.dopesheet, "show_summary", text="Summary") @@ -144,6 +131,32 @@ class DOPESHEET_HT_header(Header): row.operator("action.paste", text="", icon='PASTEDOWN') +class DOPESHEET_MT_editor_menus(Menu): + bl_idname = "DOPESHEET_MT_editor_menus" + bl_label = "" + + def draw(self, context): + self.draw_menus(self.layout, context) + + @staticmethod + def draw_menus(layout, context): + st = context.space_data + + layout.menu("DOPESHEET_MT_view") + layout.menu("DOPESHEET_MT_select") + layout.menu("DOPESHEET_MT_marker") + + if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None): + layout.menu("DOPESHEET_MT_channel") + elif st.mode == 'GPENCIL': + layout.menu("DOPESHEET_MT_gpencil_channel") + + if st.mode != 'GPENCIL': + layout.menu("DOPESHEET_MT_key") + else: + layout.menu("DOPESHEET_MT_gpencil_frame") + + class DOPESHEET_MT_view(Menu): bl_label = "View" |