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") }