func (v *SplitView) dockedBox(screenCols, screenRows int) PositionBox {
	dockRows, dockCols := v.capDockSize(screenCols, screenRows)
	switch v.Dock {
	case PosBelow:
		return PositionBox{StartCol: 0, StartRow: screenRows-dockRows, Cols: screenCols, Rows: dockRows}
	case PosAbove:
		return PositionBox{StartCol: 0, StartRow: 0, Cols: screenCols, Rows: dockRows}
	case PosLeft:
		return PositionBox{StartCol: 0, StartRow: 0, Cols: dockCols, Rows: screenRows}
	case PosRight:
		return PositionBox{StartCol: screenCols-dockCols, StartRow: 0, Cols: dockCols, Rows: screenRows}
	default:
		panic("invalid dock position")
	}
}
dockedBox computes the PositionBox for the docked pane.
package term
import (
	"github.com/gdamore/tcell"
)
type Flushable interface {
	FlushTo(screen tcell.Screen)
}
type DockPos int
const (
	PosBelow DockPos = iota
	PosAbove
	PosLeft
	PosRight
)
type Resizable interface {
	SetBox(PositionBox)
}
type PositionBox struct {
	StartCol, StartRow int
	Cols, Rows int
}
type SplitView struct {
	Dock DockPos
	DockSize int
	DockMaxPercent int
	Docked Resizable
	Flexed Resizable
}
func (v *SplitView) capDockSize(screenCols, screenRows int) (dockRows, dockCols int) {
	dockRows = v.DockSize
	dockCols = v.DockSize
	if dockRows >= screenRows {
		dockRows = screenRows - 1
	}
	if dockCols >= screenCols {
		dockCols = screenCols - 1
	}
	if dockRows < 0 {
		dockRows = 0
	}
	if dockCols < 0 {
		dockCols = 0
	}
	if v.DockMaxPercent > 0 {
		maxCols := int(float64(screenCols) * float64(v.DockMaxPercent)/100.0)
		if maxCols < dockCols {
			dockCols = maxCols
		}
		maxRows := int(float64(screenRows) * float64(v.DockMaxPercent)/100.0)
		if maxRows < dockRows {
			dockRows = maxRows
		}
	}
	return dockRows, dockCols
}