Commit d15ec5e7 authored by Philipp Hörist's avatar Philipp Hörist

ChatControl: Display show value with avatar

parent 279143f8
Pipeline #4173 passed with stages
in 3 minutes and 3 seconds
......@@ -678,19 +678,7 @@ class ChatControl(ChatControlBase):
# The name banner is drawn here
ChatControlBase.update_ui(self)
self.update_toolbar()
def _update_banner_state_image(self):
contact = app.contacts.get_contact_with_highest_priority(
self.account, self.contact.jid)
if not contact or self.resource:
# For transient contacts
contact = self.contact
show = contact.show
# Set banner image
icon = get_icon_name(show)
banner_status_img = self.xml.get_object('banner_status_image')
banner_status_img.set_from_icon_name(icon, Gtk.IconSize.DND)
self.show_avatar()
def draw_banner_text(self):
"""
......@@ -1239,11 +1227,13 @@ class ChatControl(ChatControlBase):
return
scale = self.parent_win.window.get_scale_factor()
surface = app.contacts.get_avatar(
self.account, self.contact.jid, AvatarSize.CHAT, scale)
surface = app.contacts.get_avatar(self.account,
self.contact.jid,
AvatarSize.CHAT,
scale,
self.contact.show)
image = self.xml.get_object('avatar_image')
image.set_from_surface(surface)
self.xml.avatar_image.set_from_surface(surface)
def _nec_update_avatar(self, obj):
if obj.account != self.account:
......
......@@ -560,17 +560,7 @@
</packing>
</child>
<child>
<object class="GtkImage" id="banner_status_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">3</property>
</packing>
<placeholder/>
</child>
</object>
</child>
......
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