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:
parent
dcc07f6df4
commit
4eafad5472
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 |
BIN
src/vorta/assets/icons/hdd-o-active.png
Normal file
BIN
src/vorta/assets/icons/hdd-o-active.png
Normal file
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 |
BIN
src/vorta/assets/icons/hdd-o.png
Normal file
BIN
src/vorta/assets/icons/hdd-o.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue