diff options
| author | Jeff Carr <[email protected]> | 2025-02-06 22:26:47 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-06 22:26:47 -0600 |
| commit | 37723c2b9a91ad001828f492970b94ce91ff6d4c (patch) | |
| tree | c3fbcc10849119753c69b5e3eccf3541a4c2a06b | |
| parent | 16886945edc879548719c10ad9a9a79de83cd75e (diff) | |
stdout still doesn't work with the mouse correctly
| -rw-r--r-- | eventMouseMove.go | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/eventMouseMove.go b/eventMouseMove.go index 16dee6c..77ce7f8 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -31,6 +31,22 @@ func mouseMove(g *gocui.Gui) { } } + // toggle off all highlight vies except for whatever is under the mouse + for _, view := range g.Views() { + view.Highlight = false + } + if v, err := g.ViewByPosition(w, h); err == nil { + v.Highlight = true + } + + // create the 'msg' view if it does not yet exist // TODO: put this somewhere more correct + if widgetView, _ := g.View("msg"); widgetView == nil { + if createStdout(g) { + return + } + return + } + if me.globalMouseDown && me.dropdown.active { log.Info("can't drag while dropdown is active", w, h) return @@ -86,20 +102,6 @@ func mouseMove(g *gocui.Gui) { log.Info(fmt.Sprintf("findByXY() empty. nothing to move at (%d,%d)", w, h)) } } - - if widgetView, _ := g.View("msg"); widgetView == nil { - if createStdout(g) { - return - } - return - } - - for _, view := range g.Views() { - view.Highlight = false - } - if v, err := g.ViewByPosition(w, h); err == nil { - v.Highlight = true - } } // this is how the window gets dragged around |
