mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-10-09 22:08:07 +03:00
Add basic mouse wheel support to viewport
This commit is contained in:
@@ -344,6 +344,22 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
||||
cmd = LineUp(m, lines)
|
||||
}
|
||||
}
|
||||
|
||||
case tea.MouseMsg:
|
||||
switch msg.Button {
|
||||
|
||||
case tea.MouseWheelUp:
|
||||
lines := m.ViewUp()
|
||||
if m.HighPerformanceRendering {
|
||||
cmd = ViewUp(m, lines)
|
||||
}
|
||||
|
||||
case tea.MouseWheelDown:
|
||||
lines := m.ViewDown()
|
||||
if m.HighPerformanceRendering {
|
||||
cmd = ViewDown(m, lines)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return m, cmd
|
||||
|
Reference in New Issue
Block a user