Fix #295 - avoid trimming info string if nothing to trim

This commit is contained in:
Drew Weymouth
2023-12-16 07:39:53 -08:00
parent 16c454379d
commit d10162c3cf
+4 -3
View File
@@ -87,9 +87,10 @@ func (a *AlbumInfoDialog) CreateRenderer() fyne.WidgetRenderer {
}
func (a *AlbumInfoDialog) infoLabel(info string) *widget.Label {
last := strings.LastIndex(info, "<a href")
infoWithoutLink := strings.TrimSpace(info[:last])
lbl := widget.NewLabel(infoWithoutLink)
if last := strings.LastIndex(info, "<a href"); last > 0 {
info = strings.TrimSpace(info[:last])
}
lbl := widget.NewLabel(info)
lbl.Wrapping = fyne.TextWrapWord
lbl.Alignment = fyne.TextAlignLeading
return lbl