Skip to content

Commit 5385d8b

Browse files
committed
Let trayicon owning program handle coloring it with filters
1 parent 91f250b commit 5385d8b

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

aw_qt/resources.qrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
<qresource>
44
<file alias="logo.png">../media/logo/logo.png</file>
55
<file alias="black-monochrome-logo.png">../media/logo/black-monochrome-logo.png</file>
6-
<file alias="white-monochrome-logo.png">../media/logo/white-monochrome-logo.png</file>
76
</qresource>
87
</RCC>

aw_qt/trayicon.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,9 @@ def run(manager, testing=False):
157157

158158
widget = QWidget()
159159
if sys.platform == "darwin":
160-
from Foundation import NSUserDefaults
161-
style = NSUserDefaults.standardUserDefaults().stringForKey_('AppleInterfaceStyle')
162-
if style == "Dark":
163-
icon = QIcon(":/white-monochrome-logo.png")
164-
else:
165-
icon = QIcon(":/black-monochrome-logo.png")
160+
icon = QIcon(":/black-monochrome-logo.png")
161+
# Allow macOS to use filters for changing the icon's color
162+
icon.setIsMask(True)
166163
else:
167164
icon = QIcon(":/logo.png")
168165

media

0 commit comments

Comments
 (0)