diff options
| author | Jeff Carr <[email protected]> | 2025-02-01 20:13:08 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-01 20:13:08 -0600 |
| commit | 3125bbb2580a66bf68ac8419213ec583dd625149 (patch) | |
| tree | 58677d139a79b0a564d3525e98d6f177a342445e | |
| parent | a069e6c98421be8e11a87d9ce98cf741d48e8afa (diff) | |
dragged a label kinda. exposed the real problems
| -rw-r--r-- | eventMouseMove.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/eventMouseMove.go b/eventMouseMove.go index 72f0fe6..b7e35b1 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -34,7 +34,7 @@ func mouseMove(g *gocui.Gui) { } if msgMouseDown { - log.Info("msgMouseDown == true") + // log.Info("msgMouseDown == true") // plugin will segfault if you don't keep this inside a check for msgMouseDown // don't move this code out of here for _, tk := range findByXY(w, h) { @@ -66,11 +66,20 @@ func mouseMove(g *gocui.Gui) { // this is how the window gets dragged around func (tk *guiWidget) moveNew(g *gocui.Gui) { - mx, my := g.MousePosition() + w, h := g.MousePosition() + if tk.node.WidgetType == widget.Label { + s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName) + tk.dumpWidget(s) + g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0) + me.startOutputW = w - xOffset + me.startOutputH = h - yOffset + g.SetViewOnBottom(tk.cuiName) + return + } tk.dumpWidget("moveNew() on " + tk.cuiName) - g.SetView("msg", mx-xOffset, my-yOffset, mx-xOffset+outputW, my-yOffset+outputH+me.FramePadH, 0) - me.startOutputW = mx - xOffset - me.startOutputH = my - yOffset + g.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0) + me.startOutputW = w - xOffset + me.startOutputH = h - yOffset g.SetViewOnBottom("msg") } |
