mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-23 22:32:59 +03:00
Add basic mouse wheel support to viewport
This commit is contained in:
parent
f967f6a87f
commit
c9196e5407
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user