This commit is contained in:
Jeff Carr 2025-02-04 11:12:13 -06:00
parent 9d5cd2c865
commit 012273d8d3
1 changed files with 11 additions and 11 deletions

View File

@ -39,7 +39,7 @@ func mouseMove(g *gocui.Gui) {
// don't move this code out of here
var found bool = false
if currentDrag != nil {
currentDrag.moveNew(g)
currentDrag.moveNew()
return
}
for _, tk := range findByXY(w, h) {
@ -51,19 +51,19 @@ func mouseMove(g *gocui.Gui) {
for _, tk := range findByXY(w, h) {
if tk.node.WidgetType == widget.Flag {
currentDrag = tk
// tk.moveNew(g)
// tk.moveNew()
return
}
}
for _, tk := range findByXY(w, h) {
if tk.node.WidgetType == widget.Stdout {
currentDrag = tk
// tk.moveNew(g)
// tk.moveNew()
return
}
if tk.node.WidgetType == widget.Label {
currentDrag = tk
// tk.moveNew(g)
// tk.moveNew()
return
}
found = true
@ -89,8 +89,8 @@ func mouseMove(g *gocui.Gui) {
}
// this is how the window gets dragged around
func (tk *guiWidget) moveNew(g *gocui.Gui) {
w, h := g.MousePosition()
func (tk *guiWidget) moveNew() {
w, h := me.baseGui.MousePosition()
if tk.node.WidgetType == widget.Window {
/*
w1, h1 := tk.Size()
@ -108,7 +108,7 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
if tk.node.WidgetType == widget.Flag {
// outputW, outputH := tk.Size()
// g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW+20, h-yOffset+outputH+me.FramePadH+20, 0)
g.SetView(tk.cuiName, w-3, h-3, w+20, h+20, 0)
me.baseGui.SetView(tk.cuiName, w-3, h-3, w+20, h+20, 0)
tk.verifyRect()
s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName)
tk.dumpWidget(s)
@ -117,15 +117,15 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
// g.SetViewOnBottom(tk.cuiName)
return
} else {
log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType)
// log.Info("NOT MOVE FLAG. PASSING MOVE TO MSG", tk.node.WidgetType)
}
tk.dumpWidget("moveNew() on " + tk.cuiName)
// tk.dumpWidget("moveNew() MSG" + tk.cuiName)
outputW := 180
outputH := 40
g.SetView("msg", w-xOffset, h-yOffset, w-xOffset+outputW, h-yOffset+outputH+me.FramePadH, 0)
me.baseGui.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")
me.baseGui.SetViewOnBottom("msg")
}
func createStdout(g *gocui.Gui) bool {