Merge pull request #626 from evandroforks/fix_previewer_button
Fixed previewer button not resetting the state when the preview
This commit is contained in:
commit
1d4fd50d8b
@ -1566,7 +1566,7 @@ where id in %s"""
|
|||||||
def onTogglePreview(self):
|
def onTogglePreview(self):
|
||||||
if self._previewer:
|
if self._previewer:
|
||||||
self._previewer.close()
|
self._previewer.close()
|
||||||
self._previewer = None
|
self._on_preview_closed()
|
||||||
else:
|
else:
|
||||||
self._previewer = PreviewDialog(self, self.mw, self._on_preview_closed)
|
self._previewer = PreviewDialog(self, self.mw, self._on_preview_closed)
|
||||||
self._previewer.open()
|
self._previewer.open()
|
||||||
|
@ -104,10 +104,10 @@ class Previewer(QDialog):
|
|||||||
def close(self):
|
def close(self):
|
||||||
self._on_close()
|
self._on_close()
|
||||||
super().close()
|
super().close()
|
||||||
self._close_callback()
|
|
||||||
|
|
||||||
def _on_close(self):
|
def _on_close(self):
|
||||||
self._open = False
|
self._open = False
|
||||||
|
self._close_callback()
|
||||||
|
|
||||||
def _setup_web_view(self):
|
def _setup_web_view(self):
|
||||||
jsinc = [
|
jsinc = [
|
||||||
@ -308,10 +308,6 @@ class BrowserPreviewer(MultiCardPreviewer):
|
|||||||
or self._parent.currentRow() < self._parent.model.rowCount(None) - 1
|
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:
|
def _render_scheduled(self) -> None:
|
||||||
super()._render_scheduled()
|
super()._render_scheduled()
|
||||||
self._updateButtons()
|
self._updateButtons()
|
||||||
|
Loading…
Reference in New Issue
Block a user