diff --git a/CONTRIBUTORS b/CONTRIBUTORS index daf37166e9b..765b12e228c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -187,7 +187,7 @@ Christian Donat Asuka Minato Dillon Baldwin Voczi -Ben Nguyen <105088397+bpnguyen107@users.noreply.github.com> +Ben Nguyen <105088397+bpnguyen107@users.noreply.github.com> Themis Demetriades Luke Bartholomew Gregory Abrasaldo @@ -203,6 +203,7 @@ hideo aoyama Ross Brown 🦙 Lukas Sommer +Tom Ampuero ******************** diff --git a/qt/aqt/browser/browser.py b/qt/aqt/browser/browser.py index 524887b08c1..c1e6d30eff2 100644 --- a/qt/aqt/browser/browser.py +++ b/qt/aqt/browser/browser.py @@ -380,6 +380,11 @@ def set_flag_func(desired_flag: int) -> Callable: add_ellipsis_to_action_label(f.actionCopy) add_ellipsis_to_action_label(f.action_forget) + if isinstance(self, AddCards): + f.actionClose.setVisible(False) + else: + f.actionClose.setVisible(True) + def _editor_web_view(self) -> EditorWebView: assert self.editor is not None editor_web_view = self.editor.web @@ -394,9 +399,11 @@ def closeEvent(self, evt: QCloseEvent | None) -> None: return assert self.editor is not None - - self.editor.call_after_note_saved(self._closeWindow) - evt.ignore() + if current_window() == self: + self.editor.call_after_note_saved(self._closeWindow) + evt.accept() + else: + evt.ignore() def _closeWindow(self) -> None: assert self.editor is not None