Sequener: Move waveform-draw option into view menu
also simplify preview/sequencer checks
This commit is contained in:
@@ -72,7 +72,6 @@ class SEQUENCER_HT_header(Header):
|
||||
row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True)
|
||||
|
||||
layout.prop(st, "view_type", expand=True, text="")
|
||||
layout.prop(st, "waveform_draw_type", text="")
|
||||
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
layout.prop(st, "display_mode", expand=True, text="")
|
||||
@@ -163,8 +162,10 @@ class SEQUENCER_MT_view(Menu):
|
||||
layout = self.layout
|
||||
|
||||
st = context.space_data
|
||||
is_preview = st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
|
||||
is_sequencer_view = st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
|
||||
|
||||
if st.view_type in {'PREVIEW'}:
|
||||
if st.view_type == 'PREVIEW':
|
||||
# Specifying the REGION_PREVIEW context is needed in preview-only
|
||||
# mode, else the lookup for the shortcut will fail in
|
||||
# wm_keymap_item_find_props() (see #32595).
|
||||
@@ -174,10 +175,10 @@ class SEQUENCER_MT_view(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
if is_sequencer_view:
|
||||
layout.operator("sequencer.view_all", text="View all Sequences")
|
||||
layout.operator("sequencer.view_selected")
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
if is_preview:
|
||||
layout.operator_context = 'INVOKE_REGION_PREVIEW'
|
||||
layout.operator("sequencer.view_all_preview", text="Fit preview in window")
|
||||
|
||||
@@ -195,12 +196,14 @@ class SEQUENCER_MT_view(Menu):
|
||||
# # XXX, invokes in the header view
|
||||
# layout.operator("sequencer.view_ghost_border", text="Overlay Border")
|
||||
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
if is_sequencer_view:
|
||||
layout.prop(st, "show_seconds")
|
||||
layout.prop(st, "show_frame_indicator")
|
||||
layout.prop(st, "show_strip_offset")
|
||||
|
||||
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
|
||||
layout.prop_menu_enum(st, "waveform_draw_type")
|
||||
|
||||
if is_preview:
|
||||
if st.display_mode == 'IMAGE':
|
||||
layout.prop(st, "show_safe_margin")
|
||||
elif st.display_mode == 'WAVEFORM':
|
||||
@@ -208,7 +211,7 @@ class SEQUENCER_MT_view(Menu):
|
||||
|
||||
layout.separator()
|
||||
|
||||
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
|
||||
if is_sequencer_view:
|
||||
layout.prop(st, "use_marker_sync")
|
||||
layout.separator()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user