def __init__(self, app, *args): QDialog.__init__(self, *args) self.app = app self.row = -1 loadUi(pathjoin(app.cwd, "gui", "preferences.ui"), self) self.darkradioButton.setIcon(QIcon(QPixmap(get_logo()))) self.lightradioButton.setIcon(QIcon(QPixmap(get_logo(dark=False)))) self.filterList.currentRowChanged.connect(self.previousRow) self.filterList.installEventFilter(self)
def update_tray(self, count = None): st = self.app.preferences.settings ai = self.icons['app'] = QIcon(QPixmap( get_logo(count or self.app.db.get_unread_count(), dark=st.value("icon/isdark").toBool()))) if 'tray' in self.icons: self.icons['tray'].setIcon(ai) else: self.icons['tray'] = QSystemTrayIcon(ai, self.app) self.icons['tray'].show()
def loadWindow(self): st = self.app.preferences.settings ai = self.icons['app'] = QIcon(QPixmap( get_logo(self.app.db.get_unread_count(), dark=st.value("icon/isdark").toBool()))) if 'tray' in self.icons: self.app.window.ui.setWindowIcon(ai) self.icons['tray'].setIcon(ai) else: self.icons['tray'] = QSystemTrayIcon(ai, self.app) self.icons['tray'].show()
def __init__(self, app, *args): QDialog.__init__(self, *args) self.app = app loadUi(pathjoin(app.cwd, "gui", "preferences.ui"), self) self.darkradioButton.setIcon(QIcon(QPixmap(get_logo()))) self.lightradioButton.setIcon(QIcon(QPixmap(get_logo(dark=False))))
def update_window_icon(self): st = self.app.preferences.settings self.app.window.ui.setWindowIcon(QIcon(QPixmap( get_logo(dark=st.value("icon/isdark", True).toBool()))))