Applet: Fix compatibility with symbolic pngs

See https://developer.gnome.org/gtk3/stable/gtk-encode-symbolic-svg.html

Also properly set the icon size.
This commit is contained in:
Clement Lefebvre 2019-09-27 22:25:58 +01:00
parent 74bdad23cf
commit 3d31537da0

View File

@ -483,8 +483,9 @@ class MenuWin(object):
else: else:
self.pixbuf = GdkPixbuf.Pixbuf.new_from_file(applet_icon) self.pixbuf = GdkPixbuf.Pixbuf.new_from_file(applet_icon)
else: else:
if applet_icon.endswith("-symbolic"): if applet_icon.endswith("symbolic"):
self.button_icon.set_from_icon_name(applet_icon, 22) self.button_icon.set_from_icon_name(applet_icon, Gtk.IconSize.DIALOG)
self.button_icon.set_pixel_size(22)
self.symbolic = True self.symbolic = True
else: else:
self.pixbuf = self.icon_theme.load_icon(applet_icon, 22 * self.scale, 0) self.pixbuf = self.icon_theme.load_icon(applet_icon, 22 * self.scale, 0)