diff options
| author | Jeff Carr <[email protected]> | 2025-02-19 04:22:26 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-19 17:39:45 -0600 |
| commit | a5800917e8383929e5c9dc8ad0265d6a4b4357bf (patch) | |
| tree | 3805524ee25d083ce742007e26e31cb08b449628 | |
| parent | c64592f326aa4a76d9c773e2d4f8b775fac86b02 (diff) | |
still more
| -rw-r--r-- | debug.go | 10 | ||||
| -rw-r--r-- | place.go | 22 | ||||
| -rw-r--r-- | size.go | 8 |
3 files changed, 20 insertions, 20 deletions
@@ -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()) } @@ -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:") } @@ -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 } } |
