UI: Replace +/- menus with collapsible ones
Patch D160, by Scott Petrovic with own modifications.
This commit is contained in:
@@ -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"
|
||||
|
||||
|
Reference in New Issue
Block a user