summaryrefslogtreecommitdiff
path: root/client/ui.go
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-06-07 14:57:04 -0500
committercitrons <citrons@mondecitronne.com>2025-06-07 16:02:18 -0500
commit855e61c53c8a401c6f0be84a63808cb94cb19903 (patch)
tree5f03c5357cf6aa75db05376cf6a42cc67d1e33c8 /client/ui.go
parent553ebc26cda61b567418205f7ee60be122b3c84f (diff)
channel list scrolling
Diffstat (limited to 'client/ui.go')
-rw-r--r--client/ui.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/client/ui.go b/client/ui.go
index ab5e190..d3692ce 100644
--- a/client/ui.go
+++ b/client/ui.go
@@ -58,7 +58,6 @@ func (a *application) onInput(ev tui.Event) {
}
buf := win.Buffer()
- buf.Scroll(-ev.Mouse.Scroll * 5)
scroll := tui.Size().Height - 5
switch ev.Key {
@@ -96,9 +95,11 @@ func (a *application) onInput(ev tui.Event) {
}
case keys.Up | keys.Alt:
- a.channelList.traverse(-1)
+ index := a.channelList.traverse(-1)
+ a.channelScroll.Set(index - 5)
case keys.Down | keys.Alt:
- a.channelList.traverse(1)
+ index := a.channelList.traverse(1)
+ a.channelScroll.Set(index - 5)
case 'p' | keys.Ctrl:
a.traverseHistory(-1)
@@ -196,7 +197,7 @@ func (a *application) show() {
Dir: tui.Right,
})
- a.channelList.show()
+ a.channelList.show(&a.channelScroll)
tui.Push("border", tui.Box {Width: 1, Height: tui.Fill})
tui.Text(strings.Repeat("│", s.Height), nil)
tui.Pop()