WIP - doesn't quite work yet

This commit is contained in:
Drew Weymouth
2024-05-29 20:04:06 -07:00
parent a9b6d0cc2a
commit 680cfb42d2
11 changed files with 112 additions and 44 deletions
+16
View File
@@ -25,6 +25,10 @@ type FocusListRow interface {
fyne.Focusable
ItemID() widget.ListItemID
SetItemID(widget.ListItemID)
SetOnTapped(func())
SetOnDoubleTapped(func())
SetOnFocusNeighbor(func(up bool))
}
func NewFocusList(len func() int, create func() fyne.CanvasObject, update func(widget.GridWrapItemID, fyne.CanvasObject)) *FocusList {
@@ -102,6 +106,18 @@ type FocusListRowBase struct {
selectionRect *canvas.Rectangle
}
func (l *FocusListRowBase) SetOnTapped(f func()) {
l.OnTapped = f
}
func (l *FocusListRowBase) SetOnDoubleTapped(f func()) {
l.OnDoubleTapped = f
}
func (l *FocusListRowBase) SetOnFocusNeighbor(f func(up bool)) {
l.OnFocusNeighbor = f
}
func (l *FocusListRowBase) ItemID() widget.ListItemID {
return l.ListItemID
}