Skip to content

Commit

Permalink
add scrolltooffset
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Feb 18, 2024
1 parent eb1627b commit 925c4f1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,23 @@ func (l *List) ScrollToTop() {
l.Refresh()
}

// ScrollToOffset scrolls the list to the given offset position.
//
// Since: 2.5
func (l *List) ScrollToOffset(offset float32) {
if l.scroller != nil {
l.scroller.Offset.Y = offset
l.offsetUpdated(l.scroller.Offset)
}
}

// GetScrollOffset returns the current scroll offset position
//
// Since: 2.5
func (l *List) GetScrollOffset() float32 {
return l.offsetY
}

// TypedKey is called if a key event happens while this List is focused.
//
// Implements: fyne.Focusable
Expand Down

0 comments on commit 925c4f1

Please sign in to comment.