Update docs and test coverage

This commit is contained in:
Veronica Berglyd Olsen
2024-06-20 23:32:02 +02:00
parent ea7f3fe51c
commit 5665efd9d7
3 changed files with 137 additions and 10 deletions
+5 -8
View File
@@ -1172,16 +1172,13 @@ class GuiMain(QMainWindow):
@pyqtSlot(nwDocAction)
def _passDocumentAction(self, action: nwDocAction) -> None:
"""Pass on a document action to the document viewer if it has
focus, or pass it to the document editor if it or any of its
child widgets have focus. If neither has focus, ignore it.
"""Pass on a document action to the editor or viewer based on
which one has focus, or if neither has focus, ignore it.
"""
if self.docViewer.hasFocus():
self.docViewer.docAction(action)
elif self.docEditor.hasFocus():
if self.docEditor.hasFocus():
self.docEditor.docAction(action)
else:
logger.debug("Action cancelled as neither editor nor viewer has focus")
elif self.docViewer.hasFocus():
self.docViewer.docAction(action)
return
@pyqtSlot(str)