Skip to content

Commit

Permalink
Add shortcut to toggle Auto-build
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik Koski committed Jul 8, 2024
1 parent 28fec9e commit 40c1e43
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spinetoolbox/spine_db_editor/widgets/custom_qgraphicsviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
QPushButton,
QRadioButton,
)
from PySide6.QtGui import QCursor, QPainter, QIcon, QAction, QPageSize, QPixmap, QKeySequence
from PySide6.QtGui import QCursor, QPainter, QIcon, QAction, QPageSize, QPixmap, QKeySequence, QShortcut
from PySide6.QtPrintSupport import QPrinter
from PySide6.QtSvg import QSvgGenerator
from .custom_qwidgets import ExportAsVideoDialog
Expand Down Expand Up @@ -127,7 +127,11 @@ def __init__(self, parent=None):
overlay.setFixedSize(100, 100)
layout = QVBoxLayout()
self._auto_build_button = QRadioButton("Auto-build")
self._auto_build_button.setToolTip("<p>Whether to build the graph when the tree selections change.</p>")
self._auto_build_button.setToolTip(
"<p>Whether to build the graph when the tree selections change (Ctrl+F5).</p>"
)
self._auto_rebuild_shortcut = QShortcut(QKeySequence(Qt.Modifier.CTRL | Qt.Key.Key_F5), self)
self._auto_rebuild_shortcut.activated.connect(lambda: self._auto_build_button.toggle())
self._rebuild_button = QPushButton("Rebuild (F5)")
layout.addWidget(self._auto_build_button)
layout.addWidget(self._rebuild_button)
Expand Down

0 comments on commit 40c1e43

Please sign in to comment.