Merge pull request #268 from wagoodman/tree-dim-overflow
Fix right border + file tree header for attributes
This commit is contained in:
commit
bf90d13567
@ -95,7 +95,7 @@ func (lm *Manager) planAndLayoutColumns(g *gocui.Gui, area Area) (Area, error) {
|
||||
widths[idx] = -1
|
||||
}
|
||||
variableColumns := len(elements)
|
||||
availableWidth := area.maxX
|
||||
availableWidth := area.maxX + 1
|
||||
|
||||
// first pass: planout the column sizes based on the given requests
|
||||
for idx, element := range elements {
|
||||
|
@ -165,12 +165,12 @@ func Test_planAndLayoutColumns(t *testing.T) {
|
||||
columns: []*testElement{newTestElement(t, -1, Area{
|
||||
minX: -1,
|
||||
minY: -1,
|
||||
maxX: 119,
|
||||
maxX: 120,
|
||||
maxY: 80,
|
||||
}, LocationColumn)},
|
||||
expected: layoutReturn{
|
||||
area: Area{
|
||||
minX: 119,
|
||||
minX: 120,
|
||||
minY: -1,
|
||||
maxX: 120,
|
||||
maxY: 80,
|
||||
@ -214,13 +214,13 @@ func Test_planAndLayoutColumns(t *testing.T) {
|
||||
newTestElement(t, -1, Area{
|
||||
minX: 29,
|
||||
minY: -1,
|
||||
maxX: 119,
|
||||
maxX: 120,
|
||||
maxY: 80,
|
||||
}, LocationColumn),
|
||||
},
|
||||
expected: layoutReturn{
|
||||
area: Area{
|
||||
minX: 119,
|
||||
minX: 120,
|
||||
minY: -1,
|
||||
maxX: 120,
|
||||
maxY: 80,
|
||||
@ -280,7 +280,7 @@ func Test_layout(t *testing.T) {
|
||||
Area{
|
||||
minX: -1,
|
||||
minY: 0,
|
||||
maxX: 119,
|
||||
maxX: 120,
|
||||
maxY: 79,
|
||||
}, LocationColumn),
|
||||
},
|
||||
|
@ -404,11 +404,11 @@ func (v *FileTree) KeyHelp() string {
|
||||
func (v *FileTree) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error {
|
||||
logrus.Tracef("view.Layout(minX: %d, minY: %d, maxX: %d, maxY: %d) %s", minX, minY, maxX, maxY, v.Name())
|
||||
attributeRowSize := 0
|
||||
if !v.areAttributesVisible() {
|
||||
if v.areAttributesVisible() {
|
||||
attributeRowSize = 1
|
||||
}
|
||||
// header + attribute + border
|
||||
headerSize := 1 + attributeRowSize + 1
|
||||
// header + attribute header
|
||||
headerSize := 1 + attributeRowSize
|
||||
// note: maxY needs to account for the (invisible) border, thus a +1
|
||||
header, headerErr := g.SetView(v.Name()+"header", minX, minY, maxX, minY+headerSize+1)
|
||||
// we are going to overlap the view over the (invisible) border (so minY will be one less than expected).
|
||||
|
Loading…
x
Reference in New Issue
Block a user