X backend now understands flexible min widths
This commit is contained in:
parent
7398f146ba
commit
91e60900ad
@ -205,7 +205,7 @@ func (window *Window) resizeChildToFit () {
|
||||
window.skipChildDrawCallback = true
|
||||
if child, ok := window.child.(tomo.Flexible); ok {
|
||||
minimumHeight := child.MinimumHeightFor(window.metrics.width)
|
||||
_, minimumWidth := child.MinimumSize()
|
||||
minimumWidth, _ := child.MinimumSize()
|
||||
|
||||
|
||||
icccm.WmNormalHintsSet (
|
||||
@ -254,6 +254,7 @@ func (window *Window) childDrawCallback (region tomo.Canvas) {
|
||||
}
|
||||
|
||||
func (window *Window) childMinimumSizeChangeCallback (width, height int) {
|
||||
println("x thinks:",width, height)
|
||||
icccm.WmNormalHintsSet (
|
||||
window.backend.connection,
|
||||
window.xWindow.Id,
|
||||
|
@ -99,6 +99,7 @@ func (layout Vertical) MinimumSize (
|
||||
width += theme.Padding() * 2
|
||||
height += theme.Padding() * 2
|
||||
}
|
||||
println(width, height)
|
||||
return
|
||||
}
|
||||
|
||||
@ -112,6 +113,7 @@ func (layout Vertical) MinimumHeightFor (
|
||||
) {
|
||||
if layout.Pad {
|
||||
width -= theme.Padding() * 2
|
||||
height += theme.Padding() * 2
|
||||
}
|
||||
|
||||
for index, entry := range entries {
|
||||
@ -127,9 +129,5 @@ func (layout Vertical) MinimumHeightFor (
|
||||
height += theme.Padding()
|
||||
}
|
||||
}
|
||||
|
||||
if layout.Pad {
|
||||
height += theme.Padding() * 2
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user