somethings still wrong somewhere

This commit is contained in:
Jeff Carr 2025-02-04 10:14:00 -06:00
parent acfb80a2e7
commit 9d5cd2c865
3 changed files with 16 additions and 9 deletions

View File

@ -23,8 +23,8 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
h = h + 4
tk.DrawAt(w, h)
tk.setColor(&colorActiveW) // sets the window to Green BG
tk.placeWidgets(w, h) // compute the sizes & places for each widget
tk.showWidgets()
tk.placeWidgets(w, h) // compute the sizes & places for each widget
tk.setFullSize()
me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)

View File

@ -98,6 +98,8 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
tk.verifyRect()
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
*/
tk.gocuiSize.w0 = w
tk.gocuiSize.h0 = h
tk.redrawWindow(w, h)
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
tk.dumpWidget(s)

View File

@ -77,20 +77,25 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
case widget.Window:
newW := startW
newH := startH
var maxH int = 0
// var maxH int = 0
for _, child := range tk.children {
child.placeWidgets(newW, newH)
sizeW, sizeH := child.Size()
if sizeW < 20 {
sizeW = 20
}
/*
if sizeW < 20 {
sizeW = 20
}
*/
newW += sizeW
if sizeH > maxH {
maxH = sizeH
}
newH += sizeH
/*
if sizeH > maxH {
maxH = sizeH
}
*/
}
return newW - startW, maxH
return newW - startW, newH - startH
case widget.Tab:
case widget.Grid:
return tk.placeGrid(startW, startH)