2025-02-01 11:42:31 -06:00
|
|
|
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by the GPL 3.0
|
|
|
|
|
2024-02-02 14:49:17 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2025-02-04 13:31:48 -06:00
|
|
|
"fmt"
|
|
|
|
|
2024-02-02 14:49:17 -06:00
|
|
|
"go.wit.com/widget"
|
|
|
|
)
|
|
|
|
|
2024-02-05 03:19:08 -06:00
|
|
|
// re-draws the buttons for each of the windows
|
2025-02-04 13:31:48 -06:00
|
|
|
func (tk *guiWidget) redoWindows(nextW int, nextH int) {
|
2024-02-02 14:49:17 -06:00
|
|
|
|
2025-02-04 13:31:48 -06:00
|
|
|
for _, child := range tk.children {
|
2024-02-02 14:49:17 -06:00
|
|
|
if child.node.WidgetType != widget.Window {
|
|
|
|
continue
|
|
|
|
}
|
2025-02-04 13:31:48 -06:00
|
|
|
child.gocuiSize.w0 = nextW
|
|
|
|
child.gocuiSize.h0 = nextH
|
|
|
|
|
|
|
|
tmp := fmt.Sprintf("redoWindowsS (%d,%d)", nextW, nextH)
|
|
|
|
child.dumpWidget(tmp)
|
2024-02-02 14:49:17 -06:00
|
|
|
|
|
|
|
child.frame = false
|
|
|
|
child.hasTabs = false
|
|
|
|
|
2025-02-04 09:40:51 -06:00
|
|
|
// this should make the window the full size and re-draw it
|
|
|
|
child.setFullSize() // child.gocuiSetWH(nextW, nextH)
|
2024-02-05 03:05:37 -06:00
|
|
|
child.Hide()
|
2025-02-04 13:31:48 -06:00
|
|
|
child.DrawAt(nextW, nextH)
|
|
|
|
child.Show()
|
|
|
|
|
|
|
|
tmp = fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH)
|
|
|
|
child.dumpWidget(tmp)
|
2025-02-04 09:40:51 -06:00
|
|
|
|
2025-02-04 13:31:48 -06:00
|
|
|
nextW += child.gocuiSize.Width() + 4
|
|
|
|
child.redoWindows(nextW, nextH)
|
|
|
|
/*
|
|
|
|
sizeW := child.gocuiSize.Width()
|
|
|
|
nextW += sizeW + 4
|
|
|
|
child.redoWindows(startW+3, startH+2)
|
|
|
|
*/
|
2024-02-02 14:49:17 -06:00
|
|
|
}
|
|
|
|
}
|