still more

This commit is contained in:
Jeff Carr 2025-02-19 04:22:26 -06:00
parent c64592f326
commit a5800917e8
3 changed files with 20 additions and 20 deletions

View File

@ -69,10 +69,10 @@ func (tk *guiWidget) dumpWidget(s string) {
s1 += fmt.Sprintf(" %3s %3s %3s %3s ", "", "", "", "")
}
s1 += fmt.Sprintf(" full=(%3d,%3d,%3d,%3d)", tk.full.w0, tk.full.h0, tk.full.w1, tk.full.h1)
if tk.node.Parent != nil {
if tk.node.Parent.WidgetType == widget.Grid {
s1 += fmt.Sprintf("At(%3d,%3d)", tk.node.State.AtW, tk.node.State.AtH)
s1 += fmt.Sprintf("(%3d,%3d) ", tk.parent.widths[tk.node.State.AtW], tk.parent.heights[tk.node.State.AtH])
if tk.parent != nil {
if tk.parent.WidgetType() == widget.Grid {
s1 += fmt.Sprintf("At(%3d,%3d)", tk.GridW(), tk.GridH())
s1 += fmt.Sprintf("(%3d,%3d) ", tk.parent.widths[tk.GridW()], tk.parent.heights[tk.GridH()])
} else {
s1 += fmt.Sprintf(" %3s %3s ", "", "")
s1 += fmt.Sprintf(" %3s %3s ", "", "")
@ -82,7 +82,7 @@ func (tk *guiWidget) dumpWidget(s string) {
}
var end string
if tk.WidgetType() == widget.Box {
end = fmt.Sprintf("%-8s %-8s %s %s", tk.WidgetType(), tk.cuiName, tk.node.State.Direction.String(), tk.String())
end = fmt.Sprintf("%-8s %-8s %s %s", tk.WidgetType(), tk.cuiName, tk.Direction().String(), tk.String())
} else {
end = fmt.Sprintf("%-8s %-8s %s", tk.WidgetType(), tk.cuiName, tk.String())
}

View File

@ -203,22 +203,22 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
childW, childH := child.placeWidgets(child.startW, child.startH)
// set the child's realWidth, and grid offset
if w.widths[child.node.State.AtW] < childW {
w.widths[child.node.State.AtW] = childW
if w.widths[child.GridW()] < childW {
w.widths[child.GridW()] = childW
}
if w.heights[child.node.State.AtH] < childH {
w.heights[child.node.State.AtH] = childH
if w.heights[child.GridH()] < childH {
w.heights[child.GridH()] = childH
}
if dense {
if w.heights[child.node.State.AtH] > 0 {
w.heights[child.node.State.AtH] = 1
if w.heights[child.GridH()] > 0 {
w.heights[child.GridH()] = 1
} else {
w.heights[child.node.State.AtH] = 0
w.heights[child.GridH()] = 0
}
}
// child.showWidgetPlacement("grid: ")
log.Log(INFO, "placeGrid:", child.String(), "child()", childW, childH, "At()", child.node.State.AtW, child.node.State.AtH)
log.Log(INFO, "placeGrid:", child.String(), "child()", childW, childH, "At()", child.GridW(), child.GridH())
}
var maxW int = 0
@ -230,12 +230,12 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
var totalW, totalH int
for i, w := range w.widths {
if i < child.node.State.AtW {
if i < child.GridW() {
totalW += w
}
}
for i, h := range w.heights {
if i < child.node.State.AtH {
if i < child.GridH() {
totalH += h
}
}
@ -251,7 +251,7 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
maxH = totalH
}
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.GridW(), child.GridH())
child.placeWidgets(newW, newH)
// child.showWidgetPlacement("grid2:")
}

View File

@ -91,11 +91,11 @@ func (w *guiWidget) sizeGrid() (int, int) {
sizeW, sizeH := child.Size()
// set the child's realWidth, and grid offset
if w.widths[child.node.State.AtW] < sizeW {
w.widths[child.node.State.AtW] = sizeW
if w.widths[child.GridW()] < sizeW {
w.widths[child.GridW()] = sizeW
}
if w.heights[child.node.State.AtH] < sizeH {
w.heights[child.node.State.AtH] = sizeH
if w.heights[child.GridH()] < sizeH {
w.heights[child.GridH()] = sizeH
}
}