rm more old code

This commit is contained in:
Jeff Carr 2025-02-06 02:54:50 -06:00
parent 8522d4671e
commit d0e35bb98f
3 changed files with 10 additions and 20 deletions

View File

@ -154,12 +154,12 @@ func theLetterD(g *gocui.Gui, v *gocui.View) error {
fakeStartWidth = me.FakeW
fakeStartHeight = me.TabH + me.FramePadH
if showDebug {
if me.showDebug {
showFake()
showDebug = false
me.showDebug = false
} else {
hideFake()
showDebug = true
me.showDebug = true
}
return nil
}

View File

@ -129,10 +129,7 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
// this needs to go
// event triggers when you push down on a mouse button
func msgDown(g *gocui.Gui, v *gocui.View) error {
initialMouseX, initialMouseY = g.MousePosition()
w := initialMouseX
h := initialMouseY
w, h := g.MousePosition()
for _, tk := range findByXY(w, h) {
tk.dumpWidget("msgDown()")
@ -140,8 +137,8 @@ func msgDown(g *gocui.Gui, v *gocui.View) error {
vx, vy, _, _, err := g.ViewPosition("msg")
if err == nil {
me.stdout.offsetW = initialMouseX - vx
me.stdout.offsetH = initialMouseY - vy
me.stdout.offsetW = w - vx
me.stdout.offsetH = h - vy
}
log.Info("setting mousedown to true")
// msgMouseDown = true

View File

@ -25,10 +25,9 @@ import (
// 2025 note: doesn't seem terrible to call this 'me' anymore. notsure.
var me config
var showDebug bool = true // todo: move this into config struct
var redoWidgets bool = true // todo: move this into config struct
// todo: move all this to a protobuf. then, redo all this mess. it got me here, but now it's time to clean it up for good
// todo: move all this to a protobuf. then, redo all this mess.
// it got me here, but now it's time to clean it up for good
// I can't get a GO plugins that use protobuf to load yet (versioning mismatch)
type config struct {
baseGui *gocui.Gui // the main gocui handle
treeRoot *tree.Node // the base of the binary tree. it should have id == 0
@ -68,6 +67,7 @@ type config struct {
globalMouseDown bool // yep, mouse is pressed
newWindowTrigger chan bool // work around hack to redraw windows a bit after NewWindow()
stdout stdout // information for the STDOUT window
showDebug bool // todo: move this into config struct
}
// settings for the stdout window
@ -82,13 +82,6 @@ type stdout struct {
offsetH int // the current 'h' offset
}
// deprecate these
var (
initialMouseX, initialMouseY int
// initialMouseX, initialMouseY, xOffset, yOffset int
// msgMouseDown bool
)
// this is the gocui way
// corner starts at in the upper left corner
type rectType struct {