Add a grayscale OnionShare logo for the systray icon in macOS

This commit is contained in:
Micah Lee 2017-05-22 16:23:19 -07:00
parent 65894e2e44
commit 63e491bddf
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 7 additions and 1 deletions

View File

@ -147,12 +147,18 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.check_for_updates()
def _initSystemTray(self):
system = common.get_platform()
menu = QtWidgets.QMenu()
exitAction = menu.addAction(strings._('systray_menu_exit', True))
exitAction.triggered.connect(self.close)
self.systemTray = QtWidgets.QSystemTrayIcon(self)
self.systemTray.setIcon(QtGui.QIcon(common.get_resource_path('images/logo.png')))
# The convention is Mac systray icons are always grayscale
if system == 'Darwin':
self.systemTray.setIcon(QtGui.QIcon(common.get_resource_path('images/logo_grayscale.png')))
else:
self.systemTray.setIcon(QtGui.QIcon(common.get_resource_path('images/logo.png')))
self.systemTray.setContextMenu(menu)
self.systemTray.show()

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB