Merge pull request #626 from evandroforks/fix_previewer_button

Fixed previewer button not resetting the state when the preview
This commit is contained in:
Damien Elmes 2020-05-20 12:48:17 +10:00 committed by GitHub
commit 1d4fd50d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -1566,7 +1566,7 @@ where id in %s"""
def onTogglePreview(self):
if self._previewer:
self._previewer.close()
self._previewer = None
self._on_preview_closed()
else:
self._previewer = PreviewDialog(self, self.mw, self._on_preview_closed)
self._previewer.open()

View File

@ -104,10 +104,10 @@ class Previewer(QDialog):
def close(self):
self._on_close()
super().close()
self._close_callback()
def _on_close(self):
self._open = False
self._close_callback()
def _setup_web_view(self):
jsinc = [
@ -308,10 +308,6 @@ class BrowserPreviewer(MultiCardPreviewer):
or self._parent.currentRow() < self._parent.model.rowCount(None) - 1
)
def _on_close(self):
super()._on_close()
self._parent.previewer = None
def _render_scheduled(self) -> None:
super()._render_scheduled()
self._updateButtons()