From 35740070639936070e2938c2e4c240e856e1878c Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Mon, 23 Jun 2025 23:50:11 +0800 Subject: [PATCH] Refine application lifecycle Signed-off-by: Loren Eteval --- Furious/Widget/Application.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Furious/Widget/Application.py b/Furious/Widget/Application.py index 64fa795..071feb4 100644 --- a/Furious/Widget/Application.py +++ b/Furious/Widget/Application.py @@ -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()