1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00

Add empty line underneath tab row

This commit is contained in:
makeworld 2020-12-29 23:30:44 -05:00
parent c6ad73da01
commit c9073ceb26

View File

@ -14,14 +14,22 @@ import (
// This file contains funcs that are small, self-contained utilities.
// makeContentLayout returns a flex that contains the given TextView
// along with the current correct left margin.
// along with the current correct left margin, as well as a single empty
// line at the top, for a top margin.
func makeContentLayout(tv *cview.TextView) *cview.Flex {
// Create horizontal flex with the left margin as an empty space
flex := cview.NewFlex()
flex.SetDirection(cview.FlexColumn)
flex.AddItem(nil, leftMargin(), 0, false)
flex.AddItem(tv, 0, 1, true)
return flex
horiz := cview.NewFlex()
horiz.SetDirection(cview.FlexColumn)
horiz.AddItem(nil, leftMargin(), 0, false)
horiz.AddItem(tv, 0, 1, true)
// Create a vertical flex with the other one and a top margin
vert := cview.NewFlex()
vert.SetDirection(cview.FlexRow)
vert.AddItem(nil, 1, 0, false)
vert.AddItem(horiz, 0, 1, true)
return vert
}
// makeTabLabel takes a string and adds spacing to it, making it