summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-04-20 17:23:54 +0200
committerdelthas <delthas@dille.cc>2022-04-20 17:23:54 +0200
commit20c2b265c504ae47b959e60088aa6da41bef3263 (patch)
tree7451e1397d8b87d98843a5fa5f48326a9a779e07 /app.go
parentShow/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.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app.go b/app.go
index 863b5ab..f6326c6 100644
--- a/app.go
+++ b/app.go
@@ -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)