Add tooltips to overflowing labels

This commit is contained in:
Ivaylo Draganov
2019-05-25 22:21:06 +03:00
committed by abcdefg30
parent 1fee50be2e
commit fde215360c
23 changed files with 91 additions and 30 deletions

View File

@@ -135,7 +135,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
foreach (var song in music)
{
var item = ScrollItemWidget.Setup(song.Filename, itemTemplate, () => currentSong == song, () => { currentSong = song; Play(); }, () => { });
item.Get<LabelWidget>("TITLE").GetText = () => song.Title;
var label = item.Get<LabelWithTooltipWidget>("TITLE");
WidgetUtils.TruncateLabelToTooltip(label, song.Title);
item.Get<LabelWidget>("LENGTH").GetText = () => SongLengthLabel(song);
musicList.AddChild(item);
}