Philipp Hörist pushed to branch master at gajim / gajim


Commits:
47a6b828 by Philipp Hörist at 2022-10-19T23:33:09+02:00
fix: Notification: Draw avatar correctly on scale > 1

Fixes #11229

- - - - -


2 changed files:

- gajim/gtk/avatar.py
- gajim/gtk/notification.py


Changes:

=====================================
gajim/gtk/avatar.py
=====================================
@@ -380,7 +380,11 @@ def get_pixbuf(self,
 
         surface = self.get_surface(
             contact, size, scale, show, default, transport_icon, style)
-        return Gdk.pixbuf_get_from_surface(surface, 0, 0, size, size)
+        return Gdk.pixbuf_get_from_surface(surface,
+                                           0,
+                                           0,
+                                           size * scale,
+                                           size * scale)
 
     def get_surface(self,
                     contact: Union[types.BareContact,


=====================================
gajim/gtk/notification.py
=====================================
@@ -413,8 +413,7 @@ def _get_avatar_for_notification(account: str,
     size = AvatarSize.NOTIFICATION
     client = app.get_client(account)
     contact = client.get_module('Contacts').get_contact(jid)
-    avatar_surface = contact.get_avatar(size, scale)
-    pixbuf = Gdk.pixbuf_get_from_surface(avatar_surface, 0, 0, size, size)
+    pixbuf = contact.get_avatar(size, scale, pixbuf=True)
     assert pixbuf is not None
     return pixbuf
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/47a6b8288534e70119bfcfd6bb3901b4d997ca6e

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/47a6b8288534e70119bfcfd6bb3901b4d997ca6e
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to