diff options
author | delthas <delthas@dille.cc> | 2021-10-30 15:41:48 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-10-31 09:00:10 +0100 |
commit | 5c2fb81b0b172604780362bea76a0df5c746c500 (patch) | |
tree | 6b51d015855055ce826d3563d89bd1c7e05832d7 /app.go | |
parent | Rework the /help command (diff) |
Make vertical channel list scrollable
Seems like I really have too many channels... :)
Diffstat (limited to '')
-rw-r--r-- | app.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -363,7 +363,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) { w, _ := app.win.Size() if ev.Buttons()&tcell.WheelUp != 0 { if x < app.cfg.ChanColWidth { - // TODO scroll chan list + app.win.ScrollChannelUpBy(4) } else if x > w-app.cfg.MemberColWidth { app.win.ScrollMemberUpBy(4) } else { @@ -373,7 +373,7 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) { } if ev.Buttons()&tcell.WheelDown != 0 { if x < app.cfg.ChanColWidth { - // TODO scroll chan list + app.win.ScrollChannelDownBy(4) } else if x > w-app.cfg.MemberColWidth { app.win.ScrollMemberDownBy(4) } else { @@ -381,11 +381,13 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) { } } if ev.Buttons()&tcell.ButtonPrimary != 0 && x < app.cfg.ChanColWidth { - app.win.ClickBuffer(y) + app.win.ClickBuffer(y + app.win.ChannelOffset()) } if ev.Buttons() == 0 { - if y == app.win.ClickedBuffer() && x < app.cfg.ChanColWidth { - app.win.GoToBufferNo(y) + if x < app.cfg.ChanColWidth { + if i := y + app.win.ChannelOffset(); i == app.win.ClickedBuffer() { + app.win.GoToBufferNo(i) + } } app.win.ClickBuffer(-1) } |