use QCoreApplication.instance instead of passing the instance through several objects
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user