still more
This commit is contained in:
parent
c64592f326
commit
a5800917e8
10
debug.go
10
debug.go
|
@ -69,10 +69,10 @@ func (tk *guiWidget) dumpWidget(s string) {
|
||||||
s1 += fmt.Sprintf(" %3s %3s %3s %3s ", "", "", "", "")
|
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)
|
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.parent != nil {
|
||||||
if tk.node.Parent.WidgetType == widget.Grid {
|
if tk.parent.WidgetType() == widget.Grid {
|
||||||
s1 += fmt.Sprintf("At(%3d,%3d)", tk.node.State.AtW, tk.node.State.AtH)
|
s1 += fmt.Sprintf("At(%3d,%3d)", tk.GridW(), tk.GridH())
|
||||||
s1 += fmt.Sprintf("(%3d,%3d) ", tk.parent.widths[tk.node.State.AtW], tk.parent.heights[tk.node.State.AtH])
|
s1 += fmt.Sprintf("(%3d,%3d) ", tk.parent.widths[tk.GridW()], tk.parent.heights[tk.GridH()])
|
||||||
} else {
|
} else {
|
||||||
s1 += fmt.Sprintf(" %3s %3s ", "", "")
|
s1 += fmt.Sprintf(" %3s %3s ", "", "")
|
||||||
s1 += fmt.Sprintf(" %3s %3s ", "", "")
|
s1 += fmt.Sprintf(" %3s %3s ", "", "")
|
||||||
|
@ -82,7 +82,7 @@ func (tk *guiWidget) dumpWidget(s string) {
|
||||||
}
|
}
|
||||||
var end string
|
var end string
|
||||||
if tk.WidgetType() == widget.Box {
|
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 {
|
} else {
|
||||||
end = fmt.Sprintf("%-8s %-8s %s", tk.WidgetType(), tk.cuiName, tk.String())
|
end = fmt.Sprintf("%-8s %-8s %s", tk.WidgetType(), tk.cuiName, tk.String())
|
||||||
}
|
}
|
||||||
|
|
22
place.go
22
place.go
|
@ -203,22 +203,22 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
|
||||||
childW, childH := child.placeWidgets(child.startW, child.startH)
|
childW, childH := child.placeWidgets(child.startW, child.startH)
|
||||||
|
|
||||||
// set the child's realWidth, and grid offset
|
// set the child's realWidth, and grid offset
|
||||||
if w.widths[child.node.State.AtW] < childW {
|
if w.widths[child.GridW()] < childW {
|
||||||
w.widths[child.node.State.AtW] = childW
|
w.widths[child.GridW()] = childW
|
||||||
}
|
}
|
||||||
if w.heights[child.node.State.AtH] < childH {
|
if w.heights[child.GridH()] < childH {
|
||||||
w.heights[child.node.State.AtH] = childH
|
w.heights[child.GridH()] = childH
|
||||||
}
|
}
|
||||||
if dense {
|
if dense {
|
||||||
if w.heights[child.node.State.AtH] > 0 {
|
if w.heights[child.GridH()] > 0 {
|
||||||
w.heights[child.node.State.AtH] = 1
|
w.heights[child.GridH()] = 1
|
||||||
} else {
|
} else {
|
||||||
w.heights[child.node.State.AtH] = 0
|
w.heights[child.GridH()] = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// child.showWidgetPlacement("grid: ")
|
// 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
|
var maxW int = 0
|
||||||
|
@ -230,12 +230,12 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
|
||||||
|
|
||||||
var totalW, totalH int
|
var totalW, totalH int
|
||||||
for i, w := range w.widths {
|
for i, w := range w.widths {
|
||||||
if i < child.node.State.AtW {
|
if i < child.GridW() {
|
||||||
totalW += w
|
totalW += w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i, h := range w.heights {
|
for i, h := range w.heights {
|
||||||
if i < child.node.State.AtH {
|
if i < child.GridH() {
|
||||||
totalH += h
|
totalH += h
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ func (w *guiWidget) placeGrid(startW int, startH int) (int, int) {
|
||||||
maxH = totalH
|
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.placeWidgets(newW, newH)
|
||||||
// child.showWidgetPlacement("grid2:")
|
// child.showWidgetPlacement("grid2:")
|
||||||
}
|
}
|
||||||
|
|
8
size.go
8
size.go
|
@ -91,11 +91,11 @@ func (w *guiWidget) sizeGrid() (int, int) {
|
||||||
sizeW, sizeH := child.Size()
|
sizeW, sizeH := child.Size()
|
||||||
|
|
||||||
// set the child's realWidth, and grid offset
|
// set the child's realWidth, and grid offset
|
||||||
if w.widths[child.node.State.AtW] < sizeW {
|
if w.widths[child.GridW()] < sizeW {
|
||||||
w.widths[child.node.State.AtW] = sizeW
|
w.widths[child.GridW()] = sizeW
|
||||||
}
|
}
|
||||||
if w.heights[child.node.State.AtH] < sizeH {
|
if w.heights[child.GridH()] < sizeH {
|
||||||
w.heights[child.node.State.AtH] = sizeH
|
w.heights[child.GridH()] = sizeH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue