Skip to content
Snippets Groups Projects
Commit 9d045fc6 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

avatar is now 200x200 max in vcar window. Fixes #1582

parent 54987247
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,8 @@ class Config:
'roster_avatar_height': [opt_int, 32],
'tooltip_avatar_width': [opt_int, 125],
'tooltip_avatar_height': [opt_int, 125],
'vcard_avatar_width': [opt_int, 200],
'vcard_avatar_height': [opt_int, 200],
'notification_position_x': [opt_int, -1],
'notification_position_y': [opt_int, -1],
'notification_avatar_width': [opt_int, 48],
......
......@@ -245,6 +245,8 @@ def on_set_avatar_button_clicked(self, widget):
fd = open(path_to_file, 'rb')
data = fd.read()
pixbuf = gtkgui_helpers.get_pixbuf_from_data(data)
# rescale it
pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard')
image = self.xml.get_widget('PHOTO_image')
image.set_from_pixbuf(pixbuf)
self.avatar_encoded = base64.encodestring(data)
......@@ -263,6 +265,7 @@ def set_values(self, vcard):
pixbuf, self.avatar_encoded, self.avatar_mime_type = \
get_avatar_pixbuf_encoded_mime(vcard[i])
image = self.xml.get_widget('PHOTO_image')
pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard')
image.set_from_pixbuf(pixbuf)
continue
if i == 'ADR' or i == 'TEL' or i == 'EMAIL':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment