set placeholder image when album cover is not available

This commit is contained in:
Drew Weymouth
2023-03-16 21:32:48 -07:00
parent 78258a5457
commit 69314696a0
6 changed files with 21 additions and 6 deletions
+7
View File
@@ -89,10 +89,17 @@ func (a *albumCover) center() fyne.Position {
}
func (a *albumCover) SetImage(im image.Image) {
a.Im.Resource = nil
a.Im.Image = im
a.Refresh()
}
func (a *albumCover) SetImageResource(res *fyne.StaticResource) {
a.Im.Image = nil
a.Im.Resource = res
a.Refresh()
}
func isInside(origin fyne.Position, radius float32, point fyne.Position) bool {
x, y := (point.X - origin.X), (point.Y - origin.Y)
return x*x+y*y <= radius*radius