Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-06-11 09:05:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-11 09:36:23 +0300
commite43a948a2ca7aef365ac0e6808341215e35ee4ff (patch)
tree7395786a3a3c6efd2ebbf744047ba97d811c8fec /release/scripts/startup/bl_ui/space_sequencer.py
parente916817520693302555e70931041df3d98876b51 (diff)
Sequencer: view toggle no longer cycles over SEQUENCER_PREVIEW state
- Remove the operator, use a generic operator instead. - Switch between PREVIEW/SEQUENCER as the mixed state isn't as useful. - Add menu item to make the shortcut discoverable. - Remove unused & broken "View Type" menu.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_sequencer.py')
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 26a150f83ef..abe6f614f28 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -176,17 +176,6 @@ class SEQUENCER_MT_editor_menus(Menu):
layout.menu("SEQUENCER_MT_strip")
-class SEQUENCER_MT_view_toggle(Menu):
- bl_label = "View Type"
-
- def draw(self, _context):
- layout = self.layout
-
- layout.operator("sequencer.view_toggle").type = 'SEQUENCER'
- layout.operator("sequencer.view_toggle").type = 'PREVIEW'
- layout.operator("sequencer.view_toggle").type = 'SEQUENCER_PREVIEW'
-
-
class SEQUENCER_MT_view_cache(Menu):
bl_label = "Cache"
@@ -357,6 +346,20 @@ class SEQUENCER_MT_view(Menu):
layout.separator()
+ # Note that the context is needed for the shortcut to display properly.
+ layout.operator_context = 'INVOKE_REGION_PREVIEW' if is_preview else 'INVOKE_REGION_WIN'
+ props = layout.operator(
+ "wm.context_toggle_enum",
+ text="Toggle Sequencer/Preview",
+ icon='SEQ_SEQUENCER' if is_preview else 'SEQ_PREVIEW',
+ )
+ props.data_path = "space_data.view_type"
+ props.value_1 = 'SEQUENCER'
+ props.value_2 = 'PREVIEW'
+ layout.operator_context = 'INVOKE_DEFAULT'
+
+ layout.separator()
+
layout.menu("INFO_MT_area")
@@ -2201,7 +2204,6 @@ classes = (
SEQUENCER_MT_range,
SEQUENCER_MT_view,
SEQUENCER_MT_view_cache,
- SEQUENCER_MT_view_toggle,
SEQUENCER_MT_preview_zoom,
SEQUENCER_MT_proxy,
SEQUENCER_MT_select_handle,