feat: first draft of multi-unit view

This commit is contained in:
qm210
2024-11-10 23:23:06 +01:00
parent 8d71cf3ca7
commit 5be1743204
14 changed files with 497 additions and 296 deletions

View File

@ -31,6 +31,7 @@ type DragList struct {
swapped bool
focused bool
requestFocus bool
onSelect func(index int)
}
type FilledDragListStyle struct {
@ -185,6 +186,9 @@ func (s FilledDragListStyle) Layout(gtx C) D {
if !e.Modifiers.Contain(key.ModShift) {
s.dragList.TrackerList.SetSelected2(index)
}
if s.dragList.onSelect != nil {
s.dragList.onSelect(index)
}
gtx.Execute(key.FocusCmd{Tag: s.dragList})
}
}