trying to debug grid spacing

This commit is contained in:
Jeff Carr 2025-02-06 19:34:26 -06:00
parent 2a5734892a
commit 176831d0f3
3 changed files with 41 additions and 4 deletions

View File

@ -72,8 +72,10 @@ func (tk *guiWidget) dumpWidget(s string) {
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])
} else {
s1 += fmt.Sprintf(" %3s %3s ", "", "")
s1 += fmt.Sprintf(" %3s %3s ", "", "")
}
} else {
s1 += fmt.Sprintf(" %3s %3s ", "", "")

35
size.go
View File

@ -202,6 +202,26 @@ func (tk *guiWidget) verifyRect() bool {
func (tk *guiWidget) setFullSize() bool {
r := tk.getFullSize()
if tk.Hidden() {
p := tk.parent
if p != nil {
// tk.full.w0 = p.full.w0
// tk.full.w1 = p.full.w1
// tk.full.h0 = p.full.h0
// tk.full.h1 = p.full.h1
tk.full.w0 = 0
tk.full.w1 = 0
tk.full.h0 = 0
tk.full.h1 = 0
} else {
tk.full.w0 = 0
tk.full.w1 = 0
tk.full.h0 = 0
tk.full.h1 = 0
}
return false
}
var changed bool
if tk.full.w0 != r.w0 {
tk.full.w0 = r.w0
@ -300,6 +320,21 @@ func (tk *guiWidget) buttonFullSize() rectType {
func (tk *guiWidget) getFullSize() rectType {
var r rectType
if tk.Hidden() {
/*
p := tk.parent
if p != nil {
return p.full
}
*/
var r rectType
r.w0 = 0
r.w1 = 0
r.h0 = 0
r.h1 = 0
return r
}
if tk.node.WidgetType == widget.Grid {
return tk.gridFullSize()
}

View File

@ -148,7 +148,7 @@ func (w *guiWidget) Show() {
}
*/
if w.node.Hidden() {
if w.Hidden() {
return
}
@ -169,7 +169,7 @@ func (w *guiWidget) Show() {
// this comes from the application developer
// finally, check if the widget State is hidden or not
if w.node.Hidden() {
if w.Hidden() {
// log.Log(GOCUI, "Show() w.node.Hidden() = false. not drawing", w.cuiName, w.String())
// don't display hidden widgets
return