Commit edb93cf4 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

GroupchatInfo: Show avatar

parent c690efb6
Pipeline #6329 passed with stages
in 3 minutes and 48 seconds
......@@ -19,6 +19,7 @@ class AvatarSize(IntEnum):
ROSTER = 32
CHAT = 48
NOTIFICATION = 48
GROUP_INFO = 100
TOOLTIP = 125
VCARD = 200
PUBLISH = 200
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.22.2 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkGrid" id="info_grid">
......@@ -21,7 +21,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
......@@ -37,7 +37,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
......@@ -53,7 +53,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
......@@ -69,7 +69,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
......@@ -82,7 +82,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
......@@ -99,7 +99,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
......@@ -111,7 +111,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
......@@ -123,7 +123,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
......@@ -139,7 +139,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
......@@ -155,7 +155,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
......@@ -167,7 +167,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -183,7 +183,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="top_attach">10</property>
<property name="width">2</property>
</packing>
</child>
......@@ -203,7 +203,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
......@@ -220,7 +220,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
......@@ -237,7 +237,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -254,7 +254,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
......@@ -272,7 +272,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
......@@ -289,6 +289,19 @@
<class name="large-header"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkImage" id="avatar_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">12</property>
<property name="icon_size">6</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
......
......@@ -26,6 +26,7 @@ from gajim.common.i18n import Q_
from gajim.common.helpers import open_uri
from gajim.common.helpers import get_groupchat_name
from gajim.common.const import RFC5646_LANGUAGE_TAGS
from gajim.common.const import AvatarSize
from gajim.gtk.util import get_builder
from gajim.gtk.util import make_href_markup
......@@ -150,6 +151,14 @@ class GroupChatInfoScrolled(Gtk.ScrolledWindow):
self._ui.name.set_text(name)
self._ui.name.set_visible(True)
# Set avatar
surface = app.interface.avatar_storage.get_muc_surface(
self._account,
str(info.jid),
AvatarSize.GROUP_INFO,
self.get_scale_factor())
self._ui.avatar_image.set_from_surface(surface)
# Set description
has_desc = bool(info.muc_description)
self._ui.description.set_text(info.muc_description or '')
......
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