cap the layers view based on the available terminal real estate

This commit is contained in:
Alex Goodman 2018-10-28 21:41:26 -04:00
parent fac24be5b1
commit e7a05d4b35
No known key found for this signature in database
GPG Key ID: 05328C611D8A520E

View File

@ -191,6 +191,10 @@ func layout(g *gocui.Gui) error {
filterBarIndex := 2
layersHeight := len(Views.Layer.Layers) + headerRows + 1 // layers + header + base image layer row
maxLayerHeight := int(0.75 * float64(maxY))
if layersHeight > maxLayerHeight {
layersHeight = maxLayerHeight
}
var view, header *gocui.View
var viewErr, headerErr, err error