UI: Reorganize 'View' menus in animation and video editors to make them more consistent #116492

Closed
Nika Kutsniashvili wants to merge 6 commits from nickberckley:view-menu into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
6 changed files with 80 additions and 63 deletions

View File

@ -1326,8 +1326,8 @@ class CLIP_MT_view(Menu):
sc = context.space_data
if sc.view == 'CLIP':
layout.prop(sc, "show_region_ui")
layout.prop(sc, "show_region_toolbar")
layout.prop(sc, "show_region_ui")
layout.prop(sc, "show_region_hud")
layout.separator()
@ -1336,6 +1336,7 @@ class CLIP_MT_view(Menu):
layout.operator("clip.view_all")
layout.operator("clip.view_all", text="View Fit").fit_view = True
layout.operator("clip.view_center_cursor")
layout.menu("CLIP_MT_view_zoom")
layout.separator()
@ -1345,17 +1346,16 @@ class CLIP_MT_view(Menu):
layout.separator()
layout.prop(sc, "show_metadata")
else:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("clip.graph_view_all")
if sc.view == 'GRAPH':
layout.operator("clip.graph_center_current_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.menu("CLIP_MT_view_zoom")
else:
if sc.view == 'GRAPH':
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("clip.graph_center_current_frame")
layout.operator("clip.graph_view_all")
layout.operator_context = 'INVOKE_DEFAULT'
layout.prop(sc, "show_seconds")
layout.prop(sc, "show_locked_time")

View File

@ -363,6 +363,13 @@ class DOPESHEET_MT_view(Menu):
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_hud")
layout.prop(st, "show_region_channels")
layout.separator()
layout.operator("action.view_selected")
layout.operator("action.view_all")
layout.operator("action.view_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.separator()
@ -383,8 +390,6 @@ class DOPESHEET_MT_view(Menu):
layout.separator()
layout.prop(st, "show_markers")
layout.separator()
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
@ -393,11 +398,6 @@ class DOPESHEET_MT_view(Menu):
layout.operator("anim.previewrange_clear")
layout.operator("action.previewrange_set")
layout.separator()
layout.operator("action.view_all")
layout.operator("action.view_selected")
layout.operator("action.view_frame")
# Add this to show key-binding (reverse action in dope-sheet).
layout.separator()
props = layout.operator("wm.context_set_enum", text="Toggle Graph Editor", icon='GRAPH')

View File

@ -141,15 +141,22 @@ class GRAPH_MT_view(Menu):
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_hud")
layout.separator()
layout.prop(st, "show_region_channels")
layout.separator()
layout.operator("graph.view_selected")
layout.operator("graph.view_all")
layout.operator("graph.view_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.separator()
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_cursor")
layout.prop(st, "show_sliders")
layout.prop(st, "use_auto_merge_keyframes")
layout.separator()
if st.mode != 'DRIVERS':
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_extrapolation")
@ -165,11 +172,6 @@ class GRAPH_MT_view(Menu):
layout.operator("anim.previewrange_clear")
layout.operator("graph.previewrange_set")
layout.separator()
layout.operator("graph.view_all")
layout.operator("graph.view_selected")
layout.operator("graph.view_frame")
# Add this to show key-binding (reverse action in dope-sheet).
layout.separator()
props = layout.operator("wm.context_set_enum", text="Toggle Dope Sheet")

View File

@ -114,29 +114,29 @@ class NLA_MT_view(Menu):
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_hud")
layout.prop(st, "show_region_channels")
layout.separator()
layout.operator("nla.view_selected")
layout.operator("nla.view_all")
layout.operator("nla.view_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.separator()
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.prop(st, "show_strip_curves")
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_local_markers")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.prop(st, "show_strip_curves")
layout.separator()
layout.operator("anim.previewrange_set")
layout.operator("anim.previewrange_clear")
layout.operator("nla.previewrange_set")
layout.separator()
layout.operator("nla.view_all")
layout.operator("nla.view_selected")
layout.operator("nla.view_frame")
layout.separator()
layout.menu("INFO_MT_area")

View File

@ -414,9 +414,9 @@ class SEQUENCER_MT_view(Menu):
# mode, else the lookup for the shortcut will fail in
# wm_keymap_item_find_props() (see #32595).
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.prop(st, "show_region_toolbar")
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_tool_header")
layout.prop(st, "show_region_toolbar")
layout.operator_context = 'INVOKE_DEFAULT'
if is_sequencer_view:
@ -431,7 +431,11 @@ class SEQUENCER_MT_view(Menu):
layout.prop(st, "show_transform_preview", text="Preview During Transform")
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="Refresh All")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
if st.view_type == 'PREVIEW':
# See above (#32595)
@ -447,8 +451,6 @@ class SEQUENCER_MT_view(Menu):
if is_preview:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.separator()
layout.operator("sequencer.view_all_preview", text="Fit Preview in Window")
if is_sequencer_view:
@ -469,27 +471,19 @@ class SEQUENCER_MT_view(Menu):
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="Refresh All")
layout.operator_context = 'INVOKE_DEFAULT'
if is_sequencer_view:
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
if context.preferences.view.show_developer_ui:
layout.menu("SEQUENCER_MT_view_cache", text="Show Cache")
layout.separator()
layout.operator_context = 'INVOKE_DEFAULT'
layout.menu("SEQUENCER_MT_navigation")
layout.menu("SEQUENCER_MT_range")
layout.separator()
layout.prop(st, "show_locked_time")
layout.separator()
layout.prop(st, "show_seconds")
layout.prop(st, "show_markers")
if context.preferences.view.show_developer_ui:
layout.menu("SEQUENCER_MT_view_cache", text="Show Cache")
layout.separator()
layout.operator("render.opengl", text="Sequence Render Image", icon='RENDER_STILL').sequencer = True

View File

@ -123,17 +123,37 @@ class TIME_MT_view(Menu):
scene = context.scene
st = context.space_data
layout.menu("INFO_MT_area")
layout.prop(st, "show_region_ui")
layout.prop(st, "show_region_hud")
layout.prop(st, "show_region_channels")
layout.separator()
# NOTE: "action" now, since timeline is in the dopesheet editor, instead of as own editor
layout.operator("action.view_frame")
layout.operator("action.view_selected")
layout.operator("action.view_all")
layout.operator("action.view_frame")
layout.operator("view2d.zoom_border", text="Zoom")
layout.separator()
layout.menu("TIME_MT_cache")
layout.prop(st.dopesheet, "use_multi_word_filter", text="Multi-Word Match Search")
layout.separator()
layout.prop(st, "use_realtime_update")
layout.prop(st, "show_sliders")
layout.prop(st, "use_auto_merge_keyframes")
layout.separator()
layout.prop(st, "show_markers")
layout.prop(st, "show_seconds")
layout.prop(st, "show_locked_time")
layout.separator()
layout.operator("anim.previewrange_set")
layout.operator("anim.previewrange_clear")
# NOTE: "action" now, since timeline is in the dopesheet editor, instead of as own editor
layout.operator("action.previewrange_set")
layout.separator()
@ -142,16 +162,17 @@ class TIME_MT_view(Menu):
layout.separator()
layout.prop(st, "show_markers")
layout.menu("TIME_MT_cache")
layout.separator()
props = layout.operator("wm.context_set_enum", text="Toggle Graph Editor", icon='GRAPH')
props.data_path = "area.type"
props.value = 'GRAPH_EDITOR'
layout.separator()
layout.prop(st, "show_locked_time")
layout.prop(st, "show_seconds")
layout.separator()
layout.prop(st, "show_region_hud")
layout.menu("INFO_MT_area")
class TIME_MT_cache(Menu):