inverse logic for sizes of boxes (orientation was wrong)
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
94b41aa18a
commit
56cebf6db6
9
debug.go
9
debug.go
|
@ -36,6 +36,8 @@ func (w *guiWidget) showWidgetPlacement(s string) {
|
||||||
s1 += fmt.Sprintf("gocui=(%2d,%2d,%2d,%2d)",
|
s1 += fmt.Sprintf("gocui=(%2d,%2d,%2d,%2d)",
|
||||||
w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
|
w.gocuiSize.w0, w.gocuiSize.h0, w.gocuiSize.w1, w.gocuiSize.h1)
|
||||||
} else {
|
} else {
|
||||||
|
sizeW, sizeH := w.Size()
|
||||||
|
s1 += fmt.Sprintf("size=(%2d,%2d)", sizeW, sizeH)
|
||||||
s1 += fmt.Sprintf(" ")
|
s1 += fmt.Sprintf(" ")
|
||||||
}
|
}
|
||||||
if w.node.Parent != nil {
|
if w.node.Parent != nil {
|
||||||
|
@ -43,6 +45,9 @@ func (w *guiWidget) showWidgetPlacement(s string) {
|
||||||
s1 += fmt.Sprintf("At(%2d,%2d) ", w.node.State.AtW, w.node.State.AtH)
|
s1 += fmt.Sprintf("At(%2d,%2d) ", w.node.State.AtW, w.node.State.AtH)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tmp := "." + w.String() + "."
|
tmp := "." + w.String() + ". " + w.cuiName
|
||||||
log.Log(NOW, s1, s, w.node.WidgetType, ",", tmp, "jcarr") // , "text=", w.text)
|
if w.node.WidgetType == widget.Box {
|
||||||
|
tmp = "." + w.node.State.Direction.String() + ". " + w.cuiName
|
||||||
|
}
|
||||||
|
log.Log(NOW, s1, s, w.node.WidgetType, ",", tmp) //
|
||||||
}
|
}
|
||||||
|
|
2
size.go
2
size.go
|
@ -116,7 +116,7 @@ func (w *guiWidget) sizeBox() (int, int) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
sizeW, sizeH := child.Size()
|
sizeW, sizeH := child.Size()
|
||||||
if child.node.State.Direction == widget.Horizontal {
|
if child.node.State.Direction == widget.Vertical {
|
||||||
maxW += sizeW
|
maxW += sizeW
|
||||||
if sizeH > maxH {
|
if sizeH > maxH {
|
||||||
maxH = sizeH
|
maxH = sizeH
|
||||||
|
|
Loading…
Reference in New Issue