somethings still wrong somewhere
This commit is contained in:
parent
acfb80a2e7
commit
9d5cd2c865
|
@ -23,8 +23,8 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
|
||||||
h = h + 4
|
h = h + 4
|
||||||
tk.DrawAt(w, h)
|
tk.DrawAt(w, h)
|
||||||
tk.setColor(&colorActiveW) // sets the window to Green BG
|
tk.setColor(&colorActiveW) // sets the window to Green BG
|
||||||
|
tk.placeWidgets(w, h) // compute the sizes & places for each widget
|
||||||
tk.showWidgets()
|
tk.showWidgets()
|
||||||
tk.placeWidgets(w, h) // compute the sizes & places for each widget
|
|
||||||
|
|
||||||
tk.setFullSize()
|
tk.setFullSize()
|
||||||
me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)
|
me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0)
|
||||||
|
|
|
@ -98,6 +98,8 @@ func (tk *guiWidget) moveNew(g *gocui.Gui) {
|
||||||
tk.verifyRect()
|
tk.verifyRect()
|
||||||
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
|
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
|
||||||
*/
|
*/
|
||||||
|
tk.gocuiSize.w0 = w
|
||||||
|
tk.gocuiSize.h0 = h
|
||||||
tk.redrawWindow(w, h)
|
tk.redrawWindow(w, h)
|
||||||
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
|
s := fmt.Sprintf("move(%dx%d) %s WIN", w, h, tk.cuiName)
|
||||||
tk.dumpWidget(s)
|
tk.dumpWidget(s)
|
||||||
|
|
21
place.go
21
place.go
|
@ -77,20 +77,25 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) {
|
||||||
case widget.Window:
|
case widget.Window:
|
||||||
newW := startW
|
newW := startW
|
||||||
newH := startH
|
newH := startH
|
||||||
var maxH int = 0
|
// var maxH int = 0
|
||||||
for _, child := range tk.children {
|
for _, child := range tk.children {
|
||||||
child.placeWidgets(newW, newH)
|
child.placeWidgets(newW, newH)
|
||||||
sizeW, sizeH := child.Size()
|
sizeW, sizeH := child.Size()
|
||||||
if sizeW < 20 {
|
/*
|
||||||
sizeW = 20
|
if sizeW < 20 {
|
||||||
}
|
sizeW = 20
|
||||||
|
}
|
||||||
|
*/
|
||||||
newW += sizeW
|
newW += sizeW
|
||||||
if sizeH > maxH {
|
newH += sizeH
|
||||||
maxH = sizeH
|
/*
|
||||||
}
|
if sizeH > maxH {
|
||||||
|
maxH = sizeH
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
return newW - startW, maxH
|
return newW - startW, newH - startH
|
||||||
case widget.Tab:
|
case widget.Tab:
|
||||||
case widget.Grid:
|
case widget.Grid:
|
||||||
return tk.placeGrid(startW, startH)
|
return tk.placeGrid(startW, startH)
|
||||||
|
|
Loading…
Reference in New Issue