diff options
| author | Jeff Carr <[email protected]> | 2025-02-09 12:21:43 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-09 12:21:43 -0600 |
| commit | c5cada3dc93ba0f049b50fd7561a2c15347473ee (patch) | |
| tree | 7ef0fc9e8c119f5ae86798ea10d2b8d75e281b83 /eventMouse.go | |
| parent | 87d31a3d94a26c733e3efda9dd2f60688332bc5a (diff) | |
code cleanups
Diffstat (limited to 'eventMouse.go')
| -rw-r--r-- | eventMouse.go | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/eventMouse.go b/eventMouse.go index 05880a8..935f2b5 100644 --- a/eventMouse.go +++ b/eventMouse.go @@ -110,41 +110,47 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error { log.Info("never found textbox at", w, h) return nil } - // figre out what window this is - tk := findWindowUnderMouse() - if tk == nil { + win := findWindowUnderMouse() + if win == nil { log.Info("mouseDown() nothing to click on at", w, h) return nil } - tk.makeWindowActive() - // log.Info("SENDING mouseDown() to findWindowUnderMouse()") - if tk.node.WidgetType == widget.Window { - // check to see if this is a direct click on a widget - for _, tk := range tk.findByXYreal(w, h) { - // tk.dumpWidget("mouseDown()") - if tk.node.WidgetType == widget.Button { - // log.Info("SENDING CLICK TO Button") - tk.doWidgetClick(w, h) - return nil - } - if tk.node.WidgetType == widget.Checkbox { - // log.Info("SENDING CLICK TO Checkbox") - tk.doWidgetClick(w, h) - return nil - } - if tk.node.WidgetType == widget.Dropdown { - // log.Info("SENDING CLICK TO Dropdown") - tk.doWidgetClick(w, h) - return nil - } - if tk.node.WidgetType == widget.Textbox { - // log.Info("SENDING CLICK TO Textbox") - tk.doWidgetClick(w, h) - return nil + return nil + // me.mouse.currentDrag = tk + + /* + if !tk.isWindowActive() { + tk.makeWindowActive() + return nil + } + + // log.Info("SENDING mouseDown() to findWindowUnderMouse()") + if tk.node.WidgetType == widget.Window { + // check to see if this is a direct click on a widget + for _, tk := range tk.findByXYreal(w, h) { + // tk.dumpWidget("mouseDown()") + if tk.node.WidgetType == widget.Button { + // log.Info("SENDING CLICK TO Button") + tk.doWidgetClick(w, h) + return nil + } + if tk.node.WidgetType == widget.Checkbox { + // log.Info("SENDING CLICK TO Checkbox") + tk.doWidgetClick(w, h) + return nil + } + if tk.node.WidgetType == widget.Dropdown { + // log.Info("SENDING CLICK TO Dropdown") + tk.doWidgetClick(w, h) + return nil + } + if tk.node.WidgetType == widget.Textbox { + // log.Info("SENDING CLICK TO Textbox") + tk.doWidgetClick(w, h) + return nil + } } } - } - me.mouse.currentDrag = tk - return nil + */ } |
