From c5de08d45fdf8445defa48732ffd0ffa5d566d8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Mon, 19 Feb 2018 20:34:40 +0100
Subject: [PATCH] StartChatDialog: Use HighDPI icons/avatars

---
 gajim/dialogs.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/gajim/dialogs.py b/gajim/dialogs.py
index 5f52713125..1d567a4230 100644
--- a/gajim/dialogs.py
+++ b/gajim/dialogs.py
@@ -3006,18 +3006,19 @@ class ContactRow(Gtk.Grid):
         self.new = jid == ''
 
         if self.groupchat:
-            if self.new:
-                muc_image = app.interface.jabber_state_images['32']['muc_inactive']
-            else:
-                muc_image = app.interface.jabber_state_images['32']['muc_active']
-            image = Gtk.Image.new_from_pixbuf(muc_image.get_pixbuf())
+            muc_icon = gtkgui_helpers.get_iconset_name_for(
+                'muc-inactive' if self.new else 'muc-active')
+            image = Gtk.Image.new_from_icon_name(muc_icon, Gtk.IconSize.DND)
         else:
-            avatar = app.contacts.get_avatar(account, jid, AvatarSize.ROSTER)
+            scale = self.get_scale_factor()
+            avatar = app.contacts.get_avatar(
+                account, jid, AvatarSize.ROSTER, scale)
             if avatar is None:
                 image = Gtk.Image.new_from_icon_name(
                     'avatar-default', Gtk.IconSize.DND)
             else:
-                image = Gtk.Image.new_from_pixbuf(avatar)
+                image = Gtk.Image.new_from_surface(avatar)
+
         image.set_size_request(AvatarSize.ROSTER, AvatarSize.ROSTER)
         self.add(image)
 
-- 
GitLab