Refine application lifecycle

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2025-06-23 23:50:11 +08:00
parent 1231f6f385
commit 3574007063
+7
View File
@@ -257,6 +257,11 @@ class Application(ApplicationFactory, SingletonApplication):
else:
return False
def isDarkMode(self):
backgroudColor = self.palette().color(QPalette.ColorRole.Window)
return backgroudColor.lightness() < 128
@staticmethod
def isDarkModeEnabled():
return AppSettings.isStateON_('DarkMode')
@@ -456,6 +461,8 @@ class Application(ApplicationFactory, SingletonApplication):
if AppSettings.isStateON_('DarkMode'):
self.switchToDarkMode()
else:
self.switchToAutoMode()
self.systemTray.show()
self.systemTray.setCustomToolTip()