From ba2373fdf7cda36ac4e098a963676f723c2114e1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 31 Dec 2023 01:48:39 -0600 Subject: [PATCH] pad grid and group by default Signed-off-by: Jeff Carr --- debugFlags.go | 3 ++- debugWindow.go | 7 +++++++ grid.go | 3 +++ group.go | 3 +++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/debugFlags.go b/debugFlags.go index 39c26f2..db1586a 100644 --- a/debugFlags.go +++ b/debugFlags.go @@ -52,11 +52,12 @@ func (n *Node) DebugFlags(makeWindow bool) { if (makeWindow) { w = me.rootNode.NewWindow("Debug Flags") w.Custom = w.StandardClose + w = w.NewBox("hBox", true) } else { w = n.NewTab("Flags") } - g = w.NewGroup("Show") + g = w.NewGroup("Show").Pad() g.NewButton("log.SetTmp()", func () { newlog.SetTmp() diff --git a/debugWindow.go b/debugWindow.go index c4d050b..2538fe5 100644 --- a/debugWindow.go +++ b/debugWindow.go @@ -1,5 +1,9 @@ package gui +import ( + newlog "go.wit.com/log" +) + // TODO: move all this shit into somewhere not global // main debugging window @@ -18,6 +22,9 @@ func DebugWindow() { bugWin = me.rootNode.NewWindow("go.wit.com/gui debug window").DebugTab("Debug Tab") bugWin.Custom = bugWin.StandardClose // bugWin.DebugTab("Debug Tab") + if newlog.ArgDebug() { + bugWin.DebugFlags(true) + } } func (n *Node) DebugTab(title string) *Node { diff --git a/grid.go b/grid.go index 77d64f4..9e613c2 100644 --- a/grid.go +++ b/grid.go @@ -32,6 +32,9 @@ func (n *Node) NewGrid(name string, w int, h int) *Node { a := newAction(newNode, toolkit.Add) sendAction(a) + + // by default, always pad grids + newNode.Pad() return newNode } diff --git a/group.go b/group.go index bd06d8a..298415c 100644 --- a/group.go +++ b/group.go @@ -14,6 +14,9 @@ func (parent *Node) NewGroup(name string) *Node { a := newAction(newNode, toolkit.Add) sendAction(a) + // by default, always pad groups + newNode.Pad() + newBox := newNode.NewBox("defaultGroupBox", false) return newBox }