summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2021-10-30 15:41:48 +0200
committerHubert Hirtz <hubert@hirtz.pm>2021-10-31 09:00:10 +0100
commit5c2fb81b0b172604780362bea76a0df5c746c500 (patch)
tree6b51d015855055ce826d3563d89bd1c7e05832d7 /app.go
parentRework the /help command (diff)
Make vertical channel list scrollable
Seems like I really have too many channels... :)
Diffstat (limited to '')
-rw-r--r--app.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/app.go b/app.go
index 4b9d3e8..bb552e8 100644
--- a/app.go
+++ b/app.go
@@ -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)
}