Commit 4c24e292 authored by Justin Hornosty's avatar Justin Hornosty
Browse files

Make AvatarSize.ROSTER user configurable

parent 30d1d81e
Pipeline #5923 failed with stages
in 0 seconds
......@@ -1044,10 +1044,14 @@ class ChatControl(ChatControlBase):
return label_str
def get_tab_image(self):
avatar_size_roster = app.config.get('avatar_size_roster')
if(avatar_size_roster == -1):
avatar_size_roster = AvatarSize.ROSTER
scale = self.parent_win.window.get_scale_factor()
return app.contacts.get_avatar(self.account,
self.contact.jid,
AvatarSize.ROSTER,
avatar_size_roster,
scale,
self.contact.show)
......
......@@ -250,6 +250,7 @@ class Config:
'groupchat_roster_width': [opt_int, 210, _('Width of group chat roster in pixel')],
'dev_force_bookmark_2': [opt_bool, False, _('Force Bookmark 2 usage')],
'show_help_start_chat': [opt_bool, True, _('Shows an info bar with helpful hints in the Start / Join Chat dialog')],
'avatar_size_roster': [opt_int, -1, _('sets AvatarSize.ROSTER, -1 to disable and use defaults')],
}, {}) # type: Tuple[Dict[str, List[Any]], Dict[Any, Any]]
__options_per_key = {
......
......@@ -790,10 +790,14 @@ class GroupchatControl(ChatControlBase):
return (label_str, color)
def get_tab_image(self):
avatar_size_roster = app.config.get('avatar_size_roster')
if(avatar_size_roster == -1):
avatar_size_roster = AvatarSize.ROSTER
return app.interface.avatar_storage.get_muc_surface(
self.account,
self.contact.jid,
AvatarSize.ROSTER,
avatar_size_roster,
self.scale_factor)
def _update_banner_state_image(self):
......
......@@ -1343,9 +1343,14 @@ class RosterWindow:
def _get_avatar_image(self, account, jid):
if not app.config.get('show_avatars_in_roster'):
return None
avatar_size_roster = app.config.get('avatar_size_roster')
if(avatar_size_roster == -1):
avatar_size_roster = AvatarSize.ROSTER
scale = self.window.get_scale_factor()
surface = app.contacts.get_avatar(
account, jid, AvatarSize.ROSTER, scale)
account, jid, avatar_size_roster, scale)
return Gtk.Image.new_from_surface(surface)
def draw_avatar(self, jid, account):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment