changed header resize

mine
derailed 2019-12-30 19:23:58 -07:00
parent 6a685ca643
commit 982f209b7c
2 changed files with 2 additions and 3 deletions

View File

@ -17,7 +17,6 @@ import (
const ( const (
menuIndexFmt = " [key:bg:b]<%d> [fg:bg:d]%s " menuIndexFmt = " [key:bg:b]<%d> [fg:bg:d]%s "
maxRows = 7 maxRows = 7
chopWidth = 20
) )
var menuRX = regexp.MustCompile(`\d`) var menuRX = regexp.MustCompile(`\d`)
@ -192,7 +191,7 @@ func formatNSMenu(i int, name string, styles config.Frame) string {
fmat := strings.Replace(menuIndexFmt, "[key", "["+styles.Menu.NumKeyColor, 1) fmat := strings.Replace(menuIndexFmt, "[key", "["+styles.Menu.NumKeyColor, 1)
fmat = strings.Replace(fmat, ":bg:", ":"+styles.Title.BgColor+":", -1) fmat = strings.Replace(fmat, ":bg:", ":"+styles.Title.BgColor+":", -1)
fmat = strings.Replace(fmat, "[fg", "["+styles.Menu.FgColor, 1) fmat = strings.Replace(fmat, "[fg", "["+styles.Menu.FgColor, 1)
return fmt.Sprintf(fmat, i, Truncate(name, chopWidth)) return fmt.Sprintf(fmat, i, name)
} }
func formatPlainMenu(h model.MenuHint, size int, styles config.Frame) string { func formatPlainMenu(h model.MenuHint, size int, styles config.Frame) string {

View File

@ -181,7 +181,7 @@ func (a *App) buildHeader() tview.Primitive {
if !a.showHeader { if !a.showHeader {
return header return header
} }
header.AddItem(a.clusterInfo(), 35, 1, false) header.AddItem(a.clusterInfo(), 40, 1, false)
header.AddItem(a.Menu(), 0, 1, false) header.AddItem(a.Menu(), 0, 1, false)
header.AddItem(a.Logo(), 26, 1, false) header.AddItem(a.Logo(), 26, 1, false)