Skip widget updates on spontaneous events.
Spontaneous are events external to the application such as the window manager showing or hiding the application. We don't want to update on those.
This commit is contained in:
parent
c063f5f5b9
commit
a87f34163a
|
@ -173,6 +173,8 @@ class InstallDialog(QDialog):
|
||||||
self.ui.install_dialog_layout.setSizeConstraint(QLayout.SetFixedSize)
|
self.ui.install_dialog_layout.setSizeConstraint(QLayout.SetFixedSize)
|
||||||
|
|
||||||
def showEvent(self, a0: QShowEvent) -> None:
|
def showEvent(self, a0: QShowEvent) -> None:
|
||||||
|
if a0.spontaneous():
|
||||||
|
return super().showEvent(a0)
|
||||||
self.save_install_edit(self.install_dir_edit.text())
|
self.save_install_edit(self.install_dir_edit.text())
|
||||||
super().showEvent(a0)
|
super().showEvent(a0)
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,8 @@ class GameWidget(LibraryWidget):
|
||||||
__slots__ = "ui"
|
__slots__ = "ui"
|
||||||
|
|
||||||
def showEvent(self, a0: QShowEvent) -> None:
|
def showEvent(self, a0: QShowEvent) -> None:
|
||||||
|
if a0.spontaneous():
|
||||||
|
return super().showEvent(a0)
|
||||||
if self.rgame.pixmap.isNull():
|
if self.rgame.pixmap.isNull():
|
||||||
QTimer.singleShot(random.randrange(42, 361, 7), self.rgame.load_pixmap)
|
QTimer.singleShot(random.randrange(42, 361, 7), self.rgame.load_pixmap)
|
||||||
super().showEvent(a0)
|
super().showEvent(a0)
|
||||||
|
|
|
@ -32,7 +32,10 @@ class ProgressLabel(QLabel):
|
||||||
return super().event(e)
|
return super().event(e)
|
||||||
|
|
||||||
def showEvent(self, a0: QShowEvent) -> None:
|
def showEvent(self, a0: QShowEvent) -> None:
|
||||||
|
if a0.spontaneous():
|
||||||
|
return super().showEvent(a0)
|
||||||
self.__center_on_parent()
|
self.__center_on_parent()
|
||||||
|
super().showEvent(a0)
|
||||||
|
|
||||||
def eventFilter(self, a0: QObject, a1: QEvent) -> bool:
|
def eventFilter(self, a0: QObject, a1: QEvent) -> bool:
|
||||||
if a0 is self.parent() and a1.type() == QEvent.Resize:
|
if a0 is self.parent() and a1.type() == QEvent.Resize:
|
||||||
|
|
Loading…
Reference in a new issue