summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-04-20 17:45:37 +0200
committerdelthas <delthas@dille.cc>2022-04-20 17:45:37 +0200
commit180940b653d1f9b46b164292e91a53aedd88d48d (patch)
treee3aa907deaabc8d441504203b820748c871d831b /app.go
parentScroll horizontal channel list with the mouse wheel (diff)
Enable clicking on a horizontal buffer to switch to it
This is inspired by a patch from mooff. This keeps the same click & drag behavior as for the vertical channel list.
Diffstat (limited to 'app.go')
-rw-r--r--app.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/app.go b/app.go
index f6326c6..1affe75 100644
--- a/app.go
+++ b/app.go
@@ -455,6 +455,8 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
if ev.Buttons()&tcell.ButtonPrimary != 0 {
if x < app.win.ChannelWidth() {
app.win.ClickBuffer(y + app.win.ChannelOffset())
+ } else if app.win.ChannelWidth() == 0 && y == h-1 {
+ app.win.ClickBuffer(app.win.HorizontalBufferOffset(x))
} else if x > w-app.win.MemberWidth() {
app.win.ClickMember(y + app.win.MemberOffset())
}
@@ -464,6 +466,10 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
if i := y + app.win.ChannelOffset(); i == app.win.ClickedBuffer() {
app.win.GoToBufferNo(i)
}
+ } else if app.win.ChannelWidth() == 0 && y == h-1 {
+ if i := app.win.HorizontalBufferOffset(x); i == app.win.ClickedBuffer() {
+ app.win.GoToBufferNo(i)
+ }
} else if x > w-app.win.MemberWidth() {
if i := y + app.win.MemberOffset(); i == app.win.ClickedMember() {
netID, target := app.win.CurrentBuffer()