Skip to content
Snippets Groups Projects
Commit 68c3923d authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Add zoom to fit for SFG GUI

parent 45e05dfa
No related branches found
No related tags found
1 merge request!320Add zoom to fit
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment