maybe stable with the dns control panel

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-01 10:06:09 -06:00
parent 99bb171bd9
commit e4339f33ac
3 changed files with 18 additions and 18 deletions

View File

@ -120,17 +120,17 @@ func (w *guiWidget) doWidgetClick() {
w.setColor(&colorActiveW) w.setColor(&colorActiveW)
w.active = false w.active = false
w.dumpTree("before") // w.dumpTree("before")
w.placeWidgets(3, 2) w.placeWidgets(3, 2)
w.showWidgets() w.showWidgets()
hideFake() hideFake()
showDebug = true showDebug = true
w.dumpTree("after") // w.dumpTree("after")
case widget.Group: case widget.Group:
// n.placeWidgets(p.tk.startH, newH) // n.placeWidgets(p.tk.startH, newH)
w.dumpTree("click start") // w.dumpTree("click start")
if w.active { if w.active {
w.active = false w.active = false
w.placeWidgets(w.startW, w.startH) w.placeWidgets(w.startW, w.startH)
@ -148,7 +148,7 @@ func (w *guiWidget) doWidgetClick() {
child.hideWidgets() child.hideWidgets()
} }
} }
w.dumpTree("click end") // w.dumpTree("click end")
case widget.Checkbox: case widget.Checkbox:
if widget.GetBool(w.value) { if widget.GetBool(w.value) {
w.setCheckbox(false) w.setCheckbox(false)

View File

@ -12,28 +12,28 @@ func (tk *guiWidget) placeBox(startW int, startH int) {
if tk.WidgetType != widget.Box { if tk.WidgetType != widget.Box {
return return
} }
tk.dumpTree("beforebox") // tk.dumpTree("beforebox")
newW := startW newW := startW
newH := startH newH := startH
for _, child := range tk.children { for _, child := range tk.children {
sizeW, sizeH := child.Size() sizeW, sizeH := child.Size()
log.Log(NOW, "BOX START size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH) log.Log(INFO, "BOX START size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH)
child.placeWidgets(newW, newH) child.placeWidgets(newW, newH)
sizeW, sizeH = child.Size() sizeW, sizeH = child.Size()
if child.direction == widget.Horizontal { if child.direction == widget.Horizontal {
log.Log(NOW, "BOX IS HORIZONTAL", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String()) log.Log(INFO, "BOX IS HORIZONTAL", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String())
// expand based on the child width // expand based on the child width
newW += sizeW newW += sizeW
} else { } else {
log.Log(NOW, "BOX IS VERTICAL ", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String()) log.Log(INFO, "BOX IS VERTICAL ", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String())
// expand based on the child height // expand based on the child height
newH += sizeH newH += sizeH
} }
log.Log(NOW, "BOX END size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH) log.Log(INFO, "BOX END size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH)
} }
tk.dumpTree("afterbox") // tk.dumpTree("afterbox")
} }
func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
@ -74,7 +74,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
case widget.Group: case widget.Group:
// move the group to the parent's next location // move the group to the parent's next location
tk.gocuiSetWH(startW, startH) tk.gocuiSetWH(startW, startH)
tk.dumpTree("start place") // tk.dumpTree("start place")
newW := startW + me.GroupPadW newW := startW + me.GroupPadW
newH := startH + 1 // normal hight of the group label newH := startH + 1 // normal hight of the group label
@ -93,7 +93,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
} }
log.Log(INFO, "REAL HEIGHT sizeW:", sizeW, "sizeH:", sizeH) log.Log(INFO, "REAL HEIGHT sizeW:", sizeW, "sizeH:", sizeH)
} }
tk.dumpTree("end place") // tk.dumpTree("end place")
return maxW, newH - startH return maxW, newH - startH
default: default:
tk.gocuiSetWH(startW, startH) tk.gocuiSetWH(startW, startH)
@ -103,7 +103,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
} }
func (w *guiWidget) placeGrid(startW int, startH int) (int, int) { func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
w.showWidgetPlacement("grid0:") // w.showWidgetPlacement("grid0:")
if w.WidgetType != widget.Grid { if w.WidgetType != widget.Grid {
return 0, 0 return 0, 0
} }
@ -128,7 +128,7 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
// find the width and height offset of the grid for AtW,AtH // find the width and height offset of the grid for AtW,AtH
for _, child := range w.children { for _, child := range w.children {
child.showWidgetPlacement("grid1:") // child.showWidgetPlacement("grid1:")
var totalW, totalH int var totalW, totalH int
for i, w := range w.widths { for i, w := range w.widths {
@ -155,9 +155,9 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
log.Log(INFO, "placeGrid:", child.String(), "new()", newW, newH, "At()", child.node.State.AtW, child.node.State.AtH) log.Log(INFO, "placeGrid:", child.String(), "new()", newW, newH, "At()", child.node.State.AtW, child.node.State.AtH)
child.placeWidgets(newW, newH) child.placeWidgets(newW, newH)
child.showWidgetPlacement("grid2:") // child.showWidgetPlacement("grid2:")
} }
w.showWidgetPlacement("grid3:") // w.showWidgetPlacement("grid3:")
return maxW, maxH return maxW, maxH
} }

View File

@ -43,7 +43,7 @@ func (w *guiWidget) textResize() bool {
changed = true changed = true
} }
if changed { if changed {
w.showWidgetPlacement("textResize() changed") // w.showWidgetPlacement("textResize() changed")
} }
return changed return changed
} }
@ -228,7 +228,7 @@ func (w *guiWidget) showWidgets() {
if w.isFake { if w.isFake {
// don't display by default // don't display by default
} else { } else {
w.showWidgetPlacement("current:") // w.showWidgetPlacement("current:")
w.showView() w.showView()
} }
for _, child := range w.children { for _, child := range w.children {