add PageUp / PageDown scrolling

This commit is contained in:
Drew Weymouth
2024-12-05 08:20:06 -08:00
parent 0936380fbc
commit b0b34e7791
2 changed files with 18 additions and 4 deletions
+14 -4
View File
@@ -200,14 +200,24 @@ func (b *BrowsingPane) SelectAll() {
}
func (b *BrowsingPane) ScrollUp() {
if s, ok := b.curPage.(Scrollable); ok {
s.Scroll(-75)
}
b.scrollBy(-75)
}
func (b *BrowsingPane) ScrollDown() {
b.scrollBy(75)
}
func (b *BrowsingPane) PageUp() {
b.scrollBy(-b.Size().Height * 0.9)
}
func (b *BrowsingPane) PageDown() {
b.scrollBy(b.Size().Height * 0.9)
}
func (b *BrowsingPane) scrollBy(increment float32) {
if s, ok := b.curPage.(Scrollable); ok {
s.Scroll(75)
s.Scroll(increment)
}
}