Window now checks for minimum size on adopt
This commit is contained in:
parent
437aef0c27
commit
a43f5ce595
@ -153,6 +153,9 @@ func (window *window) Adopt (child tomo.Element) {
|
|||||||
if ok && childEntity != nil {
|
if ok && childEntity != nil {
|
||||||
window.child = childEntity
|
window.child = childEntity
|
||||||
childEntity.setWindow(window)
|
childEntity.setWindow(window)
|
||||||
|
window.setMinimumSize (
|
||||||
|
childEntity.minWidth,
|
||||||
|
childEntity.minHeight)
|
||||||
window.resizeChildToFit()
|
window.resizeChildToFit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,6 @@ func (element *Checkbox) Enabled () bool {
|
|||||||
func (element *Checkbox) SetEnabled (enabled bool) {
|
func (element *Checkbox) SetEnabled (enabled bool) {
|
||||||
if element.enabled == enabled { return }
|
if element.enabled == enabled { return }
|
||||||
element.enabled = enabled
|
element.enabled = enabled
|
||||||
if element.entity == nil { return }
|
|
||||||
element.entity.Invalidate()
|
element.entity.Invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,7 +149,6 @@ func (element *Checkbox) HandleMouseUp (x, y int, button input.Button) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (element *Checkbox) HandleKeyDown (key input.Key, modifiers input.Modifiers) {
|
func (element *Checkbox) HandleKeyDown (key input.Key, modifiers input.Modifiers) {
|
||||||
if element.entity == nil { return }
|
|
||||||
if key == input.KeyEnter {
|
if key == input.KeyEnter {
|
||||||
element.pressed = true
|
element.pressed = true
|
||||||
element.entity.Invalidate()
|
element.entity.Invalidate()
|
||||||
|
|||||||
@ -51,7 +51,6 @@ func (element *Label) Entity () tomo.Entity {
|
|||||||
func (element *Label) EmCollapse (columns int, rows int) {
|
func (element *Label) EmCollapse (columns int, rows int) {
|
||||||
element.forcedColumns = columns
|
element.forcedColumns = columns
|
||||||
element.forcedRows = rows
|
element.forcedRows = rows
|
||||||
if element.entity == nil { return }
|
|
||||||
element.updateMinimumSize()
|
element.updateMinimumSize()
|
||||||
}
|
}
|
||||||
|
|
||||||