use QCoreApplication.instance instead of passing the instance through several objects

This commit is contained in:
dries.k
2023-05-30 20:53:25 +02:00
parent a7f5534c6b
commit 4eceae5a40
6 changed files with 14 additions and 24 deletions

View File

@@ -8,9 +8,8 @@ settings = Settings("gotify-tray")
class StatusWidget(QtWidgets.QLabel):
def __init__(self, app: QtWidgets.QApplication):
def __init__(self):
super(StatusWidget, self).__init__()
self.app = app
self.setFixedSize(QtCore.QSize(20, 20))
self.setScaledContents(True)
self.set_connecting()
@@ -18,7 +17,7 @@ class StatusWidget(QtWidgets.QLabel):
def set_status(self, image: str):
self.image = image
self.setPixmap(QtGui.QPixmap(get_theme_file(self.app, image)))
self.setPixmap(QtGui.QPixmap(get_theme_file(image)))
def set_active(self):
self.setToolTip("Listening for new messages")