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

ChatControl: Display show value with avatar

parent 279143f8
...@@ -678,19 +678,7 @@ def update_ui(self): ...@@ -678,19 +678,7 @@ def update_ui(self):
# The name banner is drawn here # The name banner is drawn here
ChatControlBase.update_ui(self) ChatControlBase.update_ui(self)
self.update_toolbar() self.update_toolbar()
self.show_avatar()
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)
def draw_banner_text(self): def draw_banner_text(self):
""" """
...@@ -1239,11 +1227,13 @@ def show_avatar(self): ...@@ -1239,11 +1227,13 @@ def show_avatar(self):
return return
scale = self.parent_win.window.get_scale_factor() scale = self.parent_win.window.get_scale_factor()
surface = app.contacts.get_avatar( surface = app.contacts.get_avatar(self.account,
self.account, self.contact.jid, AvatarSize.CHAT, scale) self.contact.jid,
AvatarSize.CHAT,
scale,
self.contact.show)
image = self.xml.get_object('avatar_image') self.xml.avatar_image.set_from_surface(surface)
image.set_from_surface(surface)
def _nec_update_avatar(self, obj): def _nec_update_avatar(self, obj):
if obj.account != self.account: if obj.account != self.account:
......
...@@ -560,17 +560,7 @@ ...@@ -560,17 +560,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage" id="banner_status_image"> <placeholder/>
<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>
</child> </child>
</object> </object>
</child> </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