mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-09-30 10:58:09 +03:00
Refine application lifecycle
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user