set placeholder image when album cover is not available
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user