diff options
| author | Jeff Carr <[email protected]> | 2025-02-06 05:52:00 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-06 05:52:00 -0600 |
| commit | 87141b8d990e42bcc65174a43cbd17f0578fe274 (patch) | |
| tree | ae49f57ca4e346268cf415da8a93576d90c5c01a | |
| parent | 6d991fef63b79c8c934bfc70acb783fcd6f13f89 (diff) | |
dropdown menus work pretty well
| -rw-r--r-- | eventMouse.go | 9 | ||||
| -rw-r--r-- | eventMouseMove.go | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/eventMouse.go b/eventMouse.go index c4871ec..eb89978 100644 --- a/eventMouse.go +++ b/eventMouse.go @@ -43,14 +43,15 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error { w, h := g.MousePosition() log.Info("mouseDown() stopping here. dropdwon menu is in effect") for _, tk := range findByXY(w, h) { - if tk.node.WidgetType == widget.Flag { - log.Info("SENDING CLICK TO Dropdown Flag") + if (tk.node.WidgetType == widget.Flag) && (tk == me.dropdown.tk) { + log.Info("SENDING CLICK TO Flag (dropdown)") tk.doWidgetClick(w, h) + me.dropdown.active = false return nil } } - log.Info("never found dropdown") - me.dropdown.active = false + log.Info("never found dropdown at", w, h) + // me.dropdown.active = false return nil } diff --git a/eventMouseMove.go b/eventMouseMove.go index 5fe98d3..eb6beed 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -33,6 +33,11 @@ func mouseMove(g *gocui.Gui) { } } + if me.globalMouseDown && me.dropdown.active { + log.Info("can't drag while dropdown is active", w, h) + return + } + if me.globalMouseDown { // log.Info("msgMouseDown == true") // plugin will segfault if you don't keep this inside a check for msgMouseDown |
