diff options
author | delthas <delthas@dille.cc> | 2022-04-20 17:23:54 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-04-20 17:23:54 +0200 |
commit | 20c2b265c504ae47b959e60088aa6da41bef3263 (patch) | |
tree | 7451e1397d8b87d98843a5fa5f48326a9a779e07 /app.go | |
parent | Show/hide the channel & member list with F7/F8 (diff) |
Scroll horizontal channel list with the mouse wheel
This is inspired by a patch by mooff.
The horizontal channel list can now be scrolled with the mouse wheel.
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -432,9 +432,9 @@ func (app *App) handleUIEvent(ev interface{}) bool { func (app *App) handleMouseEvent(ev *tcell.EventMouse) { x, y := ev.Position() - w, _ := app.win.Size() + w, h := app.win.Size() if ev.Buttons()&tcell.WheelUp != 0 { - if x < app.win.ChannelWidth() { + if x < app.win.ChannelWidth() || (app.win.ChannelWidth() == 0 && y == h-1) { app.win.ScrollChannelUpBy(4) } else if x > w-app.win.MemberWidth() { app.win.ScrollMemberUpBy(4) @@ -444,7 +444,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) { } } if ev.Buttons()&tcell.WheelDown != 0 { - if x < app.win.ChannelWidth() { + if x < app.win.ChannelWidth() || (app.win.ChannelWidth() == 0 && y == h-1) { app.win.ScrollChannelDownBy(4) } else if x > w-app.win.MemberWidth() { app.win.ScrollMemberDownBy(4) |