Ellipsize long display names

This commit is contained in:
fiaxh 2020-03-08 22:34:04 +01:00
parent ed6eda129e
commit efc085dc11
2 changed files with 2 additions and 1 deletions

View file

@ -6,6 +6,7 @@
<child> <child>
<object class="GtkLabel" id="name_label"> <object class="GtkLabel" id="name_label">
<property name="use_markup">True</property> <property name="use_markup">True</property>
<property name="ellipsize">end</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="visible">True</property> <property name="visible">True</property>

View file

@ -255,7 +255,7 @@ public class GlobalSearch : Overlay {
string display_name = Util.get_participant_display_name(stream_interactor, item.conversation, item.jid); string display_name = Util.get_participant_display_name(stream_interactor, item.conversation, item.jid);
string color = Util.get_name_hex_color(stream_interactor, item.message.account, item.jid, false); // TODO Util.is_dark_theme(name_label) string color = Util.get_name_hex_color(stream_interactor, item.message.account, item.jid, false); // TODO Util.is_dark_theme(name_label)
Label name_label = new Label("") { use_markup=true, xalign=0, visible=true }; Label name_label = new Label("") { ellipsize=EllipsizeMode.END, use_markup=true, xalign=0, visible=true };
name_label.label = @"<span size='small' foreground=\"#$color\">$display_name</span>"; name_label.label = @"<span size='small' foreground=\"#$color\">$display_name</span>";
grid.attach(name_label, 1, 0, 1, 1); grid.attach(name_label, 1, 0, 1, 1);
return grid; return grid;