about summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorJeffas <andrewjeffery97@gmail.com>2019-07-11 23:15:15 +0100
committerDrew DeVault <sir@cmpwn.com>2019-07-11 19:45:53 -0400
commit3b09c07e7a75feed8a9086b0a9003c2cf3ffea59 (patch)
tree9942f0f3f4529c4072946a39b75869021e9e7517 /widgets
parent4c7f81d20d1a437b59046846543ccf1a47d3c6a0 (diff)
downloadaerc-3b09c07e7a75feed8a9086b0a9003c2cf3ffea59.tar.gz
Add clickable tabs
This introduces a new interface `Clickable`. I'd imagine this would be
implemented for most widgets eventually and would allow for programs run
in the terminal to also have their mouse events forwarded to them.

For the tabs it was relatively simple to check that the position of the
click is within the boxes for the tabs. For other components I'd imagine
that some state representing their currently drawn bounding box would be
useful.
Diffstat (limited to 'widgets')
-rw-r--r--widgets/aerc.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index ade56d1..e113830 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -190,6 +190,8 @@ func (aerc *Aerc) Event(event tcell.Event) bool {
 			}
 			return false
 		}
+	case *tcell.EventMouse:
+		aerc.tabs.MouseEvent(event)
 	}
 	return false
 }