add FavoriteIcon and use in fullscreen page
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package widgets
|
||||
|
||||
import (
|
||||
"github.com/dweymouth/supersonic/ui/theme"
|
||||
)
|
||||
|
||||
type FavoriteIcon struct {
|
||||
TappableIcon
|
||||
|
||||
Favorite bool
|
||||
}
|
||||
|
||||
func NewFavoriteIcon() *FavoriteIcon {
|
||||
f := &FavoriteIcon{}
|
||||
f.Resource = theme.NotFavoriteIcon
|
||||
f.ExtendBaseWidget(f)
|
||||
return f
|
||||
}
|
||||
|
||||
func (f *FavoriteIcon) Refresh() {
|
||||
if f.Favorite {
|
||||
f.Resource = theme.FavoriteIcon
|
||||
} else {
|
||||
f.Resource = theme.NotFavoriteIcon
|
||||
}
|
||||
f.BaseWidget.Refresh()
|
||||
}
|
||||
Reference in New Issue
Block a user