grid updates, fix menu alignment

This commit is contained in:
Bradley Cicenas
2017-03-06 02:00:30 +00:00
parent 4b035ad52a
commit 38a1b305a7
5 changed files with 37 additions and 29 deletions

View File

@@ -40,7 +40,6 @@ func (c *CTopHeader) Height() int {
func headerBgBordered() *ui.Par {
bg := ui.NewPar("")
bg.X = 1
bg.Width = ui.TermWidth() - 1
bg.Height = 3
bg.Bg = ui.ColorWhite
return bg
@@ -49,7 +48,6 @@ func headerBgBordered() *ui.Par {
func headerBg() *ui.Par {
bg := ui.NewPar("")
bg.X = 1
bg.Width = ui.TermWidth() - 1
bg.Height = 1
bg.Border = false
bg.Bg = ui.ColorWhite

View File

@@ -20,13 +20,15 @@ type Menu struct {
}
func NewMenu() *Menu {
return &Menu{
m := &Menu{
Block: *ui.NewBlock(),
TextFgColor: ui.ThemeAttr("par.text.fg"),
TextBgColor: ui.ThemeAttr("par.text.bg"),
cursorPos: 0,
padding: Padding{4, 2},
}
m.X = 1
return m
}
// Append Item to Menu
@@ -119,7 +121,7 @@ func (m *Menu) NavigationHandlers() {
// Set width and height based on menu items
func (m *Menu) calcSize() {
m.Width = 8 // minimum width
m.Width = 7 // minimum width
items := m.items
for _, i := range m.items {