trying to fix windows
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
dab898f0f9
commit
2e2e68ce07
17
click.go
17
click.go
|
@ -119,8 +119,10 @@ func (w *guiWidget) doWidgetClick() {
|
|||
w.setColor(&colorActiveW)
|
||||
if w.active {
|
||||
w.active = false
|
||||
w.placeWidgets(me.RawW, me.RawH)
|
||||
w.dumpTree("before")
|
||||
w.placeWidgets(3, 2)
|
||||
w.showWidgets()
|
||||
w.dumpTree("after")
|
||||
} else {
|
||||
w.active = true
|
||||
w.hideWidgets()
|
||||
|
@ -165,22 +167,27 @@ func (w *guiWidget) doWidgetClick() {
|
|||
w.showWidgets()
|
||||
case widget.Group:
|
||||
// n.placeWidgets(p.tk.startH, newH)
|
||||
w.dumpTree("click start")
|
||||
if w.active {
|
||||
w.active = false
|
||||
startW := me.RawW
|
||||
startH := me.RawH
|
||||
startW := w.parent.AtW
|
||||
startH := w.parent.AtH
|
||||
w.placeWidgets(startW, startH)
|
||||
w.showWidgets()
|
||||
/*
|
||||
for _, child := range w.children {
|
||||
log.Log(INFO, "START W,H", startW, startH)
|
||||
child.placeWidgets(me.RawW, me.RawH)
|
||||
child.placeWidgets(startW, startH)
|
||||
child.showWidgets()
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
w.active = true
|
||||
for _, child := range w.children {
|
||||
child.hideWidgets()
|
||||
}
|
||||
}
|
||||
w.dumpTree()
|
||||
w.dumpTree("click end")
|
||||
case widget.Checkbox:
|
||||
if widget.GetBool(w.value) {
|
||||
w.setCheckbox(false)
|
||||
|
|
6
debug.go
6
debug.go
|
@ -7,16 +7,16 @@ import (
|
|||
"go.wit.com/widget"
|
||||
)
|
||||
|
||||
func (w *guiWidget) dumpTree() {
|
||||
func (w *guiWidget) dumpTree(s string) {
|
||||
// log.Log(ERROR, "dumpTree w", w.node.WidgetId, w.WidgetType, w.String())
|
||||
if w == nil {
|
||||
log.Log(ERROR, "dumpTree w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
|
||||
return
|
||||
}
|
||||
w.showWidgetPlacement("dumpTree()")
|
||||
w.showWidgetPlacement("dumpTree() " + s)
|
||||
|
||||
for _, child := range w.children {
|
||||
child.dumpTree()
|
||||
child.dumpTree(s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
6
gocui.go
6
gocui.go
|
@ -50,7 +50,7 @@ func gocuiMain() {
|
|||
func gocuiEvent(g *gocui.Gui) error {
|
||||
maxX, maxY := g.Size()
|
||||
mx, my := g.MousePosition()
|
||||
log.Log(NOW, "handleEvent() START", maxX, maxY, mx, my, msgMouseDown)
|
||||
log.Verbose("handleEvent() START", maxX, maxY, mx, my, msgMouseDown)
|
||||
if _, err := g.View("msg"); msgMouseDown && err == nil {
|
||||
moveMsg(g)
|
||||
}
|
||||
|
@ -61,10 +61,10 @@ func gocuiEvent(g *gocui.Gui) error {
|
|||
// setOutput(me.logStdout)
|
||||
}
|
||||
} else {
|
||||
log.Log(INFO, "output widget already exists", maxX, maxY, mx, my)
|
||||
log.Verbose("output widget already exists", maxX, maxY, mx, my)
|
||||
}
|
||||
mouseMove(g)
|
||||
log.Log(INFO, "handleEvent() END ", maxX, maxY, mx, my, msgMouseDown)
|
||||
log.Verbose("handleEvent() END ", maxX, maxY, mx, my, msgMouseDown)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,14 @@ func addDebugKeys(g *gocui.Gui) {
|
|||
g.SetKeybinding("", 'M', gocui.ModNone,
|
||||
func(g *gocui.Gui, v *gocui.View) error {
|
||||
w := me.treeRoot.TK.(*guiWidget)
|
||||
w.dumpTree()
|
||||
w.dumpTree("M")
|
||||
return nil
|
||||
})
|
||||
|
||||
// redo windows
|
||||
g.SetKeybinding("", 'w', gocui.ModNone,
|
||||
func(g *gocui.Gui, v *gocui.View) error {
|
||||
redoWindows(0, 0)
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
4
place.go
4
place.go
|
@ -65,7 +65,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) {
|
|||
case widget.Group:
|
||||
// move the group to the parent's next location
|
||||
tk.gocuiSetWH(startW, startH)
|
||||
tk.showWidgetPlacement("group()")
|
||||
tk.dumpTree("start place")
|
||||
|
||||
newW := startW + me.GroupPadW
|
||||
newH := startH + 3 // normal hight of the group label
|
||||
|
@ -78,7 +78,9 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) {
|
|||
|
||||
// increment straight down
|
||||
newH += h
|
||||
log.Log(INFO, "REAL HIGHT ADDED", h, "newH", newH)
|
||||
}
|
||||
tk.dumpTree("end place")
|
||||
default:
|
||||
tk.gocuiSetWH(startW, startH)
|
||||
// n.moveTo(startW, startH)
|
||||
|
|
Loading…
Reference in New Issue