From 94b41aa18a230289e30254b3a23b39c88193159a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 5 Feb 2024 04:19:32 -0600 Subject: gadget window displays correctly for some reason Signed-off-by: Jeff Carr --- place.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'place.go') diff --git a/place.go b/place.go index 1ef1775..4f24c48 100644 --- a/place.go +++ b/place.go @@ -22,13 +22,15 @@ func (tk *guiWidget) placeBox(startW int, startH int) { log.Log(INFO, "BOX START size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH) child.placeWidgets(newW, newH) sizeW, sizeH = child.Size() - if child.direction == widget.Horizontal { - log.Log(INFO, "BOX IS HORIZONTAL", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String()) - // expand based on the child width - newW += sizeW - } else { + if child.node.State.Direction == widget.Vertical { log.Log(INFO, "BOX IS VERTICAL ", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String()) // expand based on the child height + // something is wrong here + newW += sizeW + } else { + log.Log(INFO, "BOX IS HORIZONTAL", tk.String(), "newWH()", newW, newH, "child()", sizeW, sizeH, child.String()) + // expand based on the child width + // something is wrong here newH += sizeH } log.Log(INFO, "BOX END size(W,H) =", sizeW, sizeH, "new(W,H) =", newW, newH) @@ -74,7 +76,6 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { case widget.Group: // move the group to the parent's next location tk.gocuiSetWH(startW, startH) - // tk.dumpTree("start place") newW := startW + me.GroupPadW newH := startH + 1 // normal hight of the group label @@ -93,7 +94,6 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { } log.Log(INFO, "REAL HEIGHT sizeW:", sizeW, "sizeH:", sizeH) } - // tk.dumpTree("end place") return maxW, newH - startH default: tk.gocuiSetWH(startW, startH) -- cgit v1.2.3