pull in patched hyperlink bug fix from Fyne, start removing CustomHyperlink

This commit is contained in:
Drew Weymouth
2023-10-22 11:10:36 -07:00
parent bf93689bce
commit 6f08032f22
9 changed files with 104 additions and 159 deletions
+6 -4
View File
@@ -175,8 +175,8 @@ type AlbumPageHeader struct {
cover *widgets.TappableImage
titleLabel *widget.RichText
artistLabel *widgets.CustomHyperlink
genreLabel *widgets.CustomHyperlink
artistLabel *widget.Hyperlink
genreLabel *widget.Hyperlink
miscLabel *widget.Label
toggleFavButton *widgets.FavoriteButton
@@ -200,11 +200,13 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
a.titleLabel.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
SizeName: theme.SizeNameHeadingText,
}
a.artistLabel = widgets.NewCustomHyperlink()
a.artistLabel = widget.NewHyperlink("", nil)
a.artistLabel.Wrapping = fyne.TextTruncate
a.artistLabel.OnTapped = func() {
a.page.contr.NavigateTo(controller.ArtistRoute(a.artistID))
}
a.genreLabel = widgets.NewCustomHyperlink()
a.genreLabel = widget.NewHyperlink("", nil)
a.genreLabel.Wrapping = fyne.TextTruncate
a.genreLabel.OnTapped = func() {
a.page.contr.NavigateTo(controller.GenreRoute(a.genre))
}
+2 -3
View File
@@ -366,10 +366,9 @@ func (a *ArtistPageHeader) UpdateInfo(info *mediaprovider.ArtistInfo) {
break
}
if len(a.similarArtists.Objects) <= i+1 {
a.similarArtists.Add(widgets.NewCustomHyperlink())
a.similarArtists.Add(widget.NewHyperlink("", nil))
}
h := a.similarArtists.Objects[i+1].(*widgets.CustomHyperlink)
h.NoTruncate = true
h := a.similarArtists.Objects[i+1].(*widget.Hyperlink)
h.SetText(art.Name)
h.OnTapped = func(id string) func() {
return func() { a.artistPage.contr.NavigateTo(controller.ArtistRoute(id)) }