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

RosterTooltip: Improve string length for name, jid, and status

Applies ellipsizing on strings for name, jid, and status messages.
Overly long group chat topics will be shortened as well.
parent 2b980926
......@@ -42,6 +42,8 @@
<property name="halign">start</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="ellipsize">end</property>
<property name="max_width_chars">36</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
......@@ -216,7 +218,9 @@
<property name="valign">start</property>
<property name="wrap">True</property>
<property name="wrap_mode">word-char</property>
<property name="max_width_chars">25</property>
<property name="ellipsize">end</property>
<property name="max_width_chars">40</property>
<property name="lines">3</property>
<property name="xalign">0</property>
<attributes>
<attribute name="style" value="italic"/>
......@@ -233,8 +237,9 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="use_markup">True</property>
<property name="ellipsize">end</property>
<property name="single_line_mode">True</property>
<property name="max_width_chars">25</property>
<style>
<class name="large-header"/>
</style>
......
......@@ -346,25 +346,15 @@ class RosterTooltip(StatusTable):
return
self.contact_jid = self.prim_contact.jid
name = GLib.markup_escape_text(self.prim_contact.get_shown_name())
name_markup = '<b>{}</b>'.format(name)
if app.config.get('mergeaccounts'):
color = app.config.get('tooltip_account_name_color')
account_name = GLib.markup_escape_text(
self.prim_contact.account.name)
name_markup += " <span foreground='{}'>({})</span>".format(
name += " <span foreground='{}'>({})</span>".format(
color, account_name)
if account and helpers.jid_is_blocked(account, self.prim_contact.jid):
name_markup += _(' [blocked]')
try:
controls = app.interface.minimized_controls[account]
if self.prim_contact.jid in controls:
name_markup += _(' [minimized]')
except KeyError:
pass
self._ui.name.set_markup(name_markup)
self._ui.name.set_markup(name)
self._ui.name.show()
self.num_resources = 0
......
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