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

@@ -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 {