pad grid and group by default

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-12-31 01:48:39 -06:00
parent a7640472cb
commit ba2373fdf7
4 changed files with 15 additions and 1 deletions

View File

@ -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()

View File

@ -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 {

View File

@ -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
}

View File

@ -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
}