add album page showing track listing

This commit is contained in:
Drew Weymouth
2023-01-02 18:05:13 -08:00
parent e309a5ad7f
commit 632df5c1b2
10 changed files with 140 additions and 36 deletions
+7 -4
View File
@@ -64,7 +64,7 @@ type AlbumCard struct {
albumID string
artistID string
title *widget.Label
title *CustomHyperlink
artist *CustomHyperlink
year *widget.Label
container *fyne.Container
@@ -91,7 +91,7 @@ func (a *AlbumCard) MouseMoved(*desktop.MouseEvent) {}
func NewAlbumCard(showYear bool) *AlbumCard {
a := &AlbumCard{
title: widget.NewLabel(""),
title: NewCustomHyperlink(),
artist: NewCustomHyperlink(),
year: widget.NewLabel(""),
Cover: newAlbumCover(),
@@ -103,13 +103,16 @@ func NewAlbumCard(showYear bool) *AlbumCard {
a.OnPlay()
}
}
a.title.OnTapped = func() {
if a.OnShowAlbumPage != nil {
a.OnShowAlbumPage()
}
}
a.artist.OnTapped = func() {
if a.OnShowArtistPage != nil {
a.OnShowArtistPage()
}
}
a.title.Wrapping = fyne.TextTruncate
a.title.TextStyle = fyne.TextStyle{Bold: true}
a.createContainer()
return a