Skip to content
Snippets Groups Projects

Add zoom to fit

Merged Oscar Gustafsson requested to merge zoomtofit into master
1 file
+ 11
0
Compare changes
  • Side-by-side
  • Inline
+ 11
0
@@ -202,6 +202,11 @@ class SFGMainWindow(QMainWindow):
self._statusbar_visible.triggered.connect(self._toggle_statusbar)
self._ui.view_menu.addAction(self._statusbar_visible)
self._ui.view_menu.addSeparator()
self._zoom_to_fit_action = QAction("Zoom to &fit")
self._zoom_to_fit_action.triggered.connect(self._zoom_to_fit)
self._ui.view_menu.addAction(self._zoom_to_fit_action)
# Non-modal dialogs
self._keybindings_page = None
self._about_page = None
@@ -869,6 +874,12 @@ class SFGMainWindow(QMainWindow):
operation._toggle_button(pressed=True)
self.update_statusbar("Unselected all operations")
def _zoom_to_fit(self, event=None):
"""Callback for zoom to fit SFGs in window."""
self._graphics_view.fitInView(
self._scene.sceneRect(), Qt.AspectRatioMode.KeepAspectRatio
)
def _simulate_sfg(self) -> None:
"""Callback for simulating SFGs in separate threads."""
self._thread = dict()
Loading