hmm. notsure
This commit is contained in:
parent
7557486b13
commit
2062060dac
|
@ -32,18 +32,18 @@ func mouseMove(g *gocui.Gui) {
|
||||||
tk.dumpWidget("mouseMove()")
|
tk.dumpWidget("mouseMove()")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if msgMouseDown {
|
if msgMouseDown {
|
||||||
|
// 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) {
|
for _, tk := range findByXY(w, h) {
|
||||||
if tk.node == nil {
|
if tk.node.WidgetType == widget.Stdout {
|
||||||
log.Info("mouseMove() tk.node == nil")
|
// moveMsg(g)
|
||||||
} else {
|
tk.moveNew(g)
|
||||||
if tk.node.WidgetType == widget.Stdout && msgMouseDown {
|
|
||||||
moveMsg(g)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if createStdout(g) {
|
if createStdout(g) {
|
||||||
return
|
return
|
||||||
|
@ -57,6 +57,19 @@ func mouseMove(g *gocui.Gui) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is how the window gets dragged around
|
||||||
|
func (tk *guiWidget) moveNew(g *gocui.Gui) {
|
||||||
|
mx, my := g.MousePosition()
|
||||||
|
if !me.movingMsg && (mx != initialMouseX || my != initialMouseY) {
|
||||||
|
me.movingMsg = true
|
||||||
|
}
|
||||||
|
// tk.MoveToOffset(mx-xOffset, my-yOffset)
|
||||||
|
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.SetViewOnBottom("msg")
|
||||||
|
}
|
||||||
|
|
||||||
// this is how the window gets dragged around
|
// this is how the window gets dragged around
|
||||||
func moveMsg(g *gocui.Gui) {
|
func moveMsg(g *gocui.Gui) {
|
||||||
mx, my := g.MousePosition()
|
mx, my := g.MousePosition()
|
||||||
|
|
Loading…
Reference in New Issue