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 fakeStartWidth = me.FakeW
fakeStartHeight = me.TabH + me.FramePadH fakeStartHeight = me.TabH + me.FramePadH
if showDebug { if me.showDebug {
showFake() showFake()
showDebug = false me.showDebug = false
} else { } else {
hideFake() hideFake()
showDebug = true me.showDebug = true
} }
return nil return nil
} }

View File

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

View File

@ -25,10 +25,9 @@ import (
// 2025 note: doesn't seem terrible to call this 'me' anymore. notsure. // 2025 note: doesn't seem terrible to call this 'me' anymore. notsure.
var me config var me config
var showDebug bool = true // todo: move this into config struct // todo: move all this to a protobuf. then, redo all this mess.
var redoWidgets bool = true // todo: move this into config struct // 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)
// 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
type config struct { type config struct {
baseGui *gocui.Gui // the main gocui handle baseGui *gocui.Gui // the main gocui handle
treeRoot *tree.Node // the base of the binary tree. it should have id == 0 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 globalMouseDown bool // yep, mouse is pressed
newWindowTrigger chan bool // work around hack to redraw windows a bit after NewWindow() newWindowTrigger chan bool // work around hack to redraw windows a bit after NewWindow()
stdout stdout // information for the STDOUT window stdout stdout // information for the STDOUT window
showDebug bool // todo: move this into config struct
} }
// settings for the stdout window // settings for the stdout window
@ -82,13 +82,6 @@ type stdout struct {
offsetH int // the current 'h' offset offsetH int // the current 'h' offset
} }
// deprecate these
var (
initialMouseX, initialMouseY int
// initialMouseX, initialMouseY, xOffset, yOffset int
// msgMouseDown bool
)
// this is the gocui way // this is the gocui way
// corner starts at in the upper left corner // corner starts at in the upper left corner
type rectType struct { type rectType struct {