Compare commits
1 Commits
4ba563d48d
...
e602a517f6
Author | SHA1 | Date | |
---|---|---|---|
e602a517f6 |
10
widget.go
10
widget.go
|
@ -1,6 +1,8 @@
|
||||||
package ui
|
package ui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"git.kirsle.net/go/render"
|
"git.kirsle.net/go/render"
|
||||||
"git.kirsle.net/go/ui/theme"
|
"git.kirsle.net/go/ui/theme"
|
||||||
)
|
)
|
||||||
|
@ -66,7 +68,7 @@ type Widget interface {
|
||||||
// child widgets and the parent.
|
// child widgets and the parent.
|
||||||
Parent() (parent Widget, ok bool)
|
Parent() (parent Widget, ok bool)
|
||||||
SetParent(parent Widget) // for the container to assign itself the parent
|
SetParent(parent Widget) // for the container to assign itself the parent
|
||||||
Children() []Widget // for containers to return their children
|
Children() []Widget // for containers to return their children
|
||||||
|
|
||||||
// Run any render computations; by the end the widget must know its
|
// Run any render computations; by the end the widget must know its
|
||||||
// Width and Height. For example the Label widget will render itself onto
|
// Width and Height. For example the Label widget will render itself onto
|
||||||
|
@ -252,6 +254,12 @@ func (w *BaseWidget) ResizeBy(v render.Rect) {
|
||||||
|
|
||||||
// ResizeAuto sets the size of the widget but doesn't set the fixedSize flag.
|
// ResizeAuto sets the size of the widget but doesn't set the fixedSize flag.
|
||||||
func (w *BaseWidget) ResizeAuto(v render.Rect) {
|
func (w *BaseWidget) ResizeAuto(v render.Rect) {
|
||||||
|
if w.ID() == "Frame<Window Body>" {
|
||||||
|
fmt.Printf("%s: ResizeAuto Called: %+v\n",
|
||||||
|
w.ID(),
|
||||||
|
v,
|
||||||
|
)
|
||||||
|
}
|
||||||
w.width = v.W
|
w.width = v.W
|
||||||
w.height = v.H
|
w.height = v.H
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user