diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-07 19:59:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-07 20:01:59 +0300 |
commit | ba4e5399fc85e318c41380b0b1c81b23a8334786 (patch) | |
tree | 1f540ac06f2eda3370afd25a47053c4659721e50 /release/scripts/startup/bl_ui/space_topbar.py | |
parent | d04d27b406b856396102452cab0eedf315e94a54 (diff) |
Fix screenshot editor showing status text in the editor
This caused problems calling screenshot from menu-search
which included the status text in the screenshot.
Now the status text is shown in the global status bar
for any operators called from a screen context.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_topbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 1d75ad8ff0a..9d5e2a78631 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -634,6 +634,8 @@ class TOPBAR_MT_window(Menu): layout = self.layout + operator_context_default = layout.operator_context + layout.operator("wm.window_new") layout.operator("wm.window_new_main") @@ -655,7 +657,15 @@ class TOPBAR_MT_window(Menu): layout.separator() layout.operator("screen.screenshot") + + # Showing the status in the area doesn't work well in this case. + # - From the top-bar, the text replaces the file-menu (not so bad but strange). + # - From menu-search it replaces the area that the user may want to screen-shot. + # Setting the context to screen causes the status to show in the global status-bar. + print(layout.operator_context) + layout.operator_context = 'INVOKE_SCREEN' layout.operator("screen.screenshot_area") + layout.operator_context = operator_context_default if sys.platform[:3] == "win": layout.separator() |