add FavoriteIcon and use in fullscreen page

This commit is contained in:
Drew Weymouth
2024-03-01 18:12:25 -08:00
parent f1e5c55461
commit fee1dd66bb
4 changed files with 54 additions and 30 deletions
+27
View File
@@ -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()
}