add favorite (aka starred) column to tracklist

This commit is contained in:
Drew Weymouth
2023-02-21 18:10:10 -08:00
parent c4dba8f1fb
commit ae2ff2df2f
3 changed files with 104 additions and 56 deletions
+34
View File
@@ -0,0 +1,34 @@
package widgets
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/driver/desktop"
"fyne.io/fyne/v2/widget"
)
type TappableIcon struct {
widget.Icon
OnTapped func()
}
func NewTappbaleIcon(res fyne.Resource) *TappableIcon {
icon := &TappableIcon{}
icon.ExtendBaseWidget(icon)
icon.SetResource(res)
return icon
}
func (t *TappableIcon) Tapped(_ *fyne.PointEvent) {
if t.OnTapped != nil {
t.OnTapped()
}
}
func (t *TappableIcon) TappedSecondary(_ *fyne.PointEvent) {
}
func (t *TappableIcon) Cursor() desktop.Cursor {
return desktop.PointerCursor
}