summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-06 19:34:26 -0600
committerJeff Carr <[email protected]>2025-02-06 19:34:26 -0600
commit176831d0f3b7160e3c8fed56c481f43163e9a2b4 (patch)
treeb936b4d6c49e58dbbd205a2c57000a663f814527
parent2a5734892a85804b6c44a0cd8dd22d20fed21d96 (diff)
trying to debug grid spacing
-rw-r--r--debug.go6
-rw-r--r--size.go35
-rw-r--r--treeDraw.go4
3 files changed, 41 insertions, 4 deletions
diff --git a/debug.go b/debug.go
index 3c83280..e820c07 100644
--- a/debug.go
+++ b/debug.go
@@ -71,9 +71,11 @@ func (tk *guiWidget) dumpWidget(s string) {
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("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 ", "", "")
+ s1 += fmt.Sprintf(" %3s %3s ", "", "")
}
} else {
s1 += fmt.Sprintf(" %3s %3s ", "", "")
diff --git a/size.go b/size.go
index 4439298..2dd7332 100644
--- a/size.go
+++ b/size.go
@@ -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()
}
diff --git a/treeDraw.go b/treeDraw.go
index 39c8edc..ec63df5 100644
--- a/treeDraw.go
+++ b/treeDraw.go
@@ -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