ui: use file names for tray icon to not end up with small icons

This commit is contained in:
Peter F. Patel-Schneider 2021-10-02 08:02:23 -04:00
parent 116adf9959
commit c763886248
1 changed files with 4 additions and 3 deletions

View File

@ -45,7 +45,7 @@ del getLogger
# constants # constants
# #
_TRAY_ICON_SIZE = 32 # pixels _TRAY_ICON_SIZE = 64 # pixels - make large as downscaling is done but not always upscaling
_MENU_ICON_SIZE = Gtk.IconSize.LARGE_TOOLBAR _MENU_ICON_SIZE = Gtk.IconSize.LARGE_TOOLBAR
_RECEIVER_SEPARATOR = ('~', None, None, None) _RECEIVER_SEPARATOR = ('~', None, None, None)
@ -175,10 +175,11 @@ try:
# Defense against AppIndicator3 bug that treats files in current directory as icon files # Defense against AppIndicator3 bug that treats files in current directory as icon files
# https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1363277 # https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1363277
# Defense against bug that shows up in XFCE 4.16 where icons are not upscaled
def _icon_file(icon_name): def _icon_file(icon_name):
if not os.path.isfile(icon_name): if False and not os.path.isfile(icon_name):
return icon_name return icon_name
icon_info = Gtk.IconTheme.get_default().lookup_icon(icon_name, _TRAY_ICON_SIZE, 0) icon_info = Gtk.IconTheme.get_default().lookup_icon(icon_name, _TRAY_ICON_SIZE, Gtk.IconLookupFlags.FORCE_SVG)
return icon_info.get_filename() if icon_info else icon_name return icon_info.get_filename() if icon_info else icon_name
def _create(menu): def _create(menu):