can almost drag two different things

This commit is contained in:
Jeff Carr 2025-02-03 00:07:48 -06:00
parent a5b3a934d2
commit c5e6c66338
3 changed files with 19 additions and 12 deletions

View File

@ -75,26 +75,30 @@ func (tk *guiWidget) verifyRect() bool {
} }
var ok bool = true var ok bool = true
if vw0 != tk.gocuiSize.w0 { if vw0 != tk.gocuiSize.w0 {
tk.dumpWidget("verifyRect() err w0") // tk.dumpWidget("verifyRect() err w0")
tk.gocuiSize.w0 = vw0
ok = false ok = false
} }
if vw1 != tk.gocuiSize.w1 { if vw1 != tk.gocuiSize.w1 {
tk.dumpWidget("verifyRect() err w1") // tk.dumpWidget("verifyRect() err w1")
tk.gocuiSize.w0 = vw1
ok = false ok = false
} }
if vh0 != tk.gocuiSize.h0 { if vh0 != tk.gocuiSize.h0 {
tk.dumpWidget("verifyRect() err h0") // tk.dumpWidget("verifyRect() err h0")
tk.gocuiSize.h0 = vh0
ok = false ok = false
} }
if vh1 != tk.gocuiSize.h1 { if vh1 != tk.gocuiSize.h1 {
tk.dumpWidget("verifyRect() err h1") tk.gocuiSize.h1 = vh1
// tk.dumpWidget("verifyRect() err h1")
ok = false ok = false
} }
if !ok { if !ok {
log.Info("verifyRect() NEED TO FIX RECT HERE", tk.cuiName) // log.Info("verifyRect() NEED TO FIX RECT HERE", tk.cuiName)
tk.dumpWidget("verifyRect() FIXME") // tk.dumpWidget("verifyRect() FIXME")
} }
log.Printf("verifyRect() OK cuiName=%s v.Name=%s", tk.cuiName, tk.v.Name()) // log.Printf("verifyRect() OK cuiName=%s v.Name=%s", tk.cuiName, tk.v.Name())
return true return true
} }

View File

@ -25,6 +25,7 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
log.Info("mouseUp() setting me.globalMouseDown = false") log.Info("mouseUp() setting me.globalMouseDown = false")
me.globalMouseDown = false me.globalMouseDown = false
currentDrag = nil
dropdownUnclicked(w, h) dropdownUnclicked(w, h)

View File

@ -53,7 +53,7 @@ func mouseMove(g *gocui.Gui) {
} }
for _, tk := range findByXY(w, h) { for _, tk := range findByXY(w, h) {
if tk.node.WidgetType == widget.Stdout { if tk.node.WidgetType == widget.Stdout {
// currentDrag = tk currentDrag = tk
// tk.moveNew(g) // tk.moveNew(g)
return return
} }
@ -90,12 +90,14 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
if tk.node.WidgetType == widget.Flag { if tk.node.WidgetType == widget.Flag {
log.Info("MOVE FLAG") log.Info("MOVE FLAG")
log.Info("MOVE FLAG") log.Info("MOVE 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)
tk.verifyRect()
s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName) s := fmt.Sprintf("move(%dx%d) %s ###", w, h, tk.cuiName)
tk.dumpWidget(s) tk.dumpWidget(s)
outputW, outputH := tk.Size() // me.startOutputW = w - xOffset
g.SetView(tk.cuiName, w-xOffset, h-yOffset, w-xOffset+outputW+20, h-yOffset+outputH+me.FramePadH+20, 0) // me.startOutputH = h - yOffset
me.startOutputW = w - xOffset
me.startOutputH = h - yOffset
// g.SetViewOnBottom(tk.cuiName) // g.SetViewOnBottom(tk.cuiName)
return return
} else { } else {