Commit a9b2922b authored by Daniel Brötzmann's avatar Daniel Brötzmann

GroupChatInvitation: Show account badge

Fixes: #10424
parent 25ddc9d2
Pipeline #7328 passed with stages
in 9 minutes and 21 seconds
......@@ -21,6 +21,7 @@
from .groupchat_info import GroupChatInfoScrolled
from .groupchat_nick import NickChooser
from .util import generate_account_badge
class GroupChatInvitation(Gtk.ApplicationWindow):
......@@ -50,9 +51,18 @@ def __init__(self, account, event):
separator = Gtk.Separator()
contact_label = Gtk.Label(label=event.get_inviter_name())
contact_label.get_style_context().add_class('bold16')
contact_label.set_halign(Gtk.Align.CENTER)
contact_label.set_justify(Gtk.Justification.CENTER)
contact_label.set_line_wrap(True)
contact_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
contact_box.set_halign(Gtk.Align.CENTER)
contact_box.add(contact_label)
enabled_accounts = app.get_enabled_accounts_with_labels()
if len(enabled_accounts) > 1:
account_badge = generate_account_badge(account)
account_badge.set_tooltip_text(
_('Account: %s') % app.get_account_label(account))
contact_box.add(account_badge)
invitation_label = Gtk.Label(
label=_('has invited you to a group chat.\nDo you want to join?'))
invitation_label.set_halign(Gtk.Align.CENTER)
......@@ -61,7 +71,7 @@ def __init__(self, account, event):
invitation_label.set_line_wrap(True)
main_box.add(separator)
main_box.add(contact_label)
main_box.add(contact_box)
main_box.add(invitation_label)
decline_button = Gtk.Button.new_with_mnemonic(_('_Decline'))
......
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