1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2025-02-20 21:36:58 +00:00

Use single tray icon for light and dark themes. By @samuel-w

This commit is contained in:
Samuel Woon 2020-09-07 04:36:25 -05:00 committed by GitHub
parent dcc07f6df4
commit 4eafad5472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -4,7 +4,7 @@
from vorta.borg.borg_thread import BorgThread
from vorta.models import BackupProfileModel
from vorta.utils import get_asset, uses_dark_mode
from vorta.utils import get_asset
class TrayMenu(QSystemTrayIcon):
@ -70,7 +70,6 @@ def set_tray_icon(self, active=False):
"""
Use white tray icon, when on Gnome or in dark mode. Otherwise use dark icon.
"""
use_white_icon = 'GNOME' in os.environ.get('XDG_CURRENT_DESKTOP', '') or uses_dark_mode()
icon_name = f"icons/hdd-o{'-active' if active else ''}-{'light' if use_white_icon else 'dark'}.png"
icon_name = f"icons/hdd-o{'-active' if active else ''}.png"
icon = QIcon(get_asset(icon_name))
self.setIcon(icon)