From 899b7bf510966619a44acadf82023748e39d6529 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 4 Nov 2024 08:53:12 -0500 Subject: [PATCH] MAINT: Clean up raw.plot capture (#12938) Co-authored-by: Daniel McCloy --- mne/viz/_scraper.py | 10 ++++------ tutorials/epochs/40_autogenerate_metadata.py | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mne/viz/_scraper.py b/mne/viz/_scraper.py index a6b74106b30..7ca653f0a0d 100644 --- a/mne/viz/_scraper.py +++ b/mne/viz/_scraper.py @@ -52,15 +52,13 @@ def __call__(self, block, block_vars, gallery_conf): @contextmanager def _screenshot_mode(browser): - if hasattr(browser.mne, "toolbar"): # if there is an error, it might not - browser.mne.toolbar.setVisible(False) - browser.statusBar().setVisible(False) + if need_zen := browser.mne.scrollbars_visible: + browser._toggle_zenmode() try: yield finally: - if hasattr(browser.mne, "toolbar"): - browser.mne.toolbar.setVisible(True) - browser.statusBar().setVisible(True) + if need_zen: + browser._toggle_zenmode() def _mne_qt_browser_screenshot(browser, inst=None, return_type="pixmap"): diff --git a/tutorials/epochs/40_autogenerate_metadata.py b/tutorials/epochs/40_autogenerate_metadata.py index cd43699cd13..16fe907b7a9 100644 --- a/tutorials/epochs/40_autogenerate_metadata.py +++ b/tutorials/epochs/40_autogenerate_metadata.py @@ -29,7 +29,6 @@ negativity (ERN), i.e. the ERP component associated with incorrect behavioral responses. - .. _tut-autogenerate-metadata-preparation: Preparation