From 7e8a920575a30e153d608bd8e8940544cc75cc8b Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Mon, 29 Apr 2024 09:26:44 +0800 Subject: [PATCH] Add isTrayAction field in AppQAction Signed-off-by: Loren Eteval --- Furious/QtFramework/QtGui.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Furious/QtFramework/QtGui.py b/Furious/QtFramework/QtGui.py index 0eb1e36..2958d77 100644 --- a/Furious/QtFramework/QtGui.py +++ b/Furious/QtFramework/QtGui.py @@ -70,6 +70,7 @@ class AppQAction(QTranslatable, SupportThemeChangedCallback, QAction): statusTip=None, callback=None, shortcut=None, + isTrayAction=False, **kwargs, ): super().__init__(text=text, **kwargs) @@ -77,6 +78,7 @@ class AppQAction(QTranslatable, SupportThemeChangedCallback, QAction): # Do not use QProtection because it's been managed somewhere else!!! self.useQProtection = False self.iconFileName = '' + self.isTrayAction = isTrayAction self.setShortcutVisibleInContextMenu(True) @@ -175,8 +177,8 @@ class AppQAction(QTranslatable, SupportThemeChangedCallback, QAction): # Windows. Always use black icon super().setIcon(bootstrapIcon(self.iconFileName)) else: - if getUbuntuRelease() == '20.04': - # Ubuntu 20.04 system dark theme does not change menu color. + if getUbuntuRelease() == '20.04' and self.isTrayAction: + # Ubuntu 20.04 system dark theme does not change tray menu color. # Make it go black always super().setIcon(bootstrapIcon(self.iconFileName)) else: