Skip to content

Commit 60962aa

Browse files
committed
Enhance screenshot functionality by adjusting widget width and adding demo mode for consistent results
1 parent 59b643e commit 60962aa

5 files changed

Lines changed: 6 additions & 0 deletions

File tree

datalab/gui/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,9 +745,15 @@ def execute_post_show_actions(self) -> None:
745745

746746
def take_screenshot(self, name: str) -> None: # pragma: no cover
747747
"""Take main window screenshot"""
748+
# For esthetic reasons, we set the central widget width to a lower value:
749+
old_width = self.tabwidget.maximumWidth()
750+
self.tabwidget.setMaximumWidth(500)
751+
# To avoid having screenshot depending on memory status, we set demo mode ON:
748752
self.memorystatus.set_demo_mode(True)
749753
qth.grab_save_window(self, f"{name}")
754+
# Restore previous state:
750755
self.memorystatus.set_demo_mode(False)
756+
self.tabwidget.setMaximumWidth(old_width)
751757

752758
def take_menu_screenshots(self) -> None: # pragma: no cover
753759
"""Take menu screenshots"""

doc/images/shots/i_beautiful.png

-1.16 KB
Loading
50.3 KB
Loading
2.41 KB
Loading

doc/images/shots/s_beautiful.png

14.4 KB
Loading

0 commit comments

Comments
 (0)