parent
f4559a16cc
commit
b1189acd14
2
go.mod
2
go.mod
|
|
@ -5,7 +5,7 @@ go 1.14
|
|||
require (
|
||||
github.com/atotto/clipboard v0.1.2
|
||||
github.com/derailed/popeye v0.8.8
|
||||
github.com/derailed/tview v0.4.0
|
||||
github.com/derailed/tview v0.4.1
|
||||
github.com/drone/envsubst v1.0.2 // indirect
|
||||
github.com/fatih/color v1.9.0
|
||||
github.com/fsnotify/fsnotify v1.4.7
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@ type (
|
|||
Table struct {
|
||||
FgColor Color `yaml:"fgColor"`
|
||||
BgColor Color `yaml:"bgColor"`
|
||||
CursorColor Color `yaml:"cursorColor"`
|
||||
CursorFgColor Color `yaml:"cursorFgColor"`
|
||||
CursorBgColor Color `yaml:"cursorBgColor"`
|
||||
MarkColor Color `yaml:"markColor"`
|
||||
Header TableHeader `yaml:"header"`
|
||||
}
|
||||
|
|
@ -145,6 +146,7 @@ type (
|
|||
FgColor Color `yaml:"fgColor"`
|
||||
BgColor Color `yaml:"bgColor"`
|
||||
CursorColor Color `yaml:"cursorColor"`
|
||||
CursorTextColor Color `yaml:"cursorTextColor"`
|
||||
GraphicColor Color `yaml:"graphicColor"`
|
||||
}
|
||||
|
||||
|
|
@ -226,6 +228,7 @@ func newCharts() Charts {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
func newViews() Views {
|
||||
return Views{
|
||||
Table: newTable(),
|
||||
|
|
@ -312,6 +315,7 @@ func newXray() Xray {
|
|||
FgColor: "aqua",
|
||||
BgColor: "black",
|
||||
CursorColor: "whitesmoke",
|
||||
CursorTextColor: "black",
|
||||
GraphicColor: "floralwhite",
|
||||
}
|
||||
}
|
||||
|
|
@ -320,7 +324,8 @@ func newTable() Table {
|
|||
return Table{
|
||||
FgColor: "aqua",
|
||||
BgColor: "black",
|
||||
CursorColor: "aqua",
|
||||
CursorFgColor: "black",
|
||||
CursorBgColor: "aqua",
|
||||
MarkColor: "palegreen",
|
||||
Header: newTableHeader(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ type SelectTable struct {
|
|||
model Tabular
|
||||
selectedFn func(string) string
|
||||
marks map[string]struct{}
|
||||
fgColor tcell.Color
|
||||
}
|
||||
|
||||
// SetModel sets the table model.
|
||||
|
|
@ -115,7 +116,8 @@ func (s *SelectTable) selectionChanged(r, c int) {
|
|||
return
|
||||
}
|
||||
cell := s.GetCell(r, c)
|
||||
s.SetSelectedStyle(tcell.ColorBlack, cell.Color, tcell.AttrBold)
|
||||
log.Debug().Msgf("COLOR %v:%v", s.fgColor, cell.Color)
|
||||
s.SetSelectedStyle(s.fgColor, cell.Color, tcell.AttrBold)
|
||||
}
|
||||
|
||||
// ClearMarks delete all marked items.
|
||||
|
|
@ -143,8 +145,11 @@ func (s *SelectTable) ToggleMark() {
|
|||
}
|
||||
|
||||
cell := s.GetCell(s.GetSelectedRowIndex(), 0)
|
||||
if cell == nil {
|
||||
return
|
||||
}
|
||||
s.SetSelectedStyle(
|
||||
tcell.ColorBlack,
|
||||
cell.BackgroundColor,
|
||||
cell.Color,
|
||||
tcell.AttrBold,
|
||||
)
|
||||
|
|
@ -193,7 +198,6 @@ func (s *SelectTable) markRange(prev, curr int) {
|
|||
if prev > curr {
|
||||
prev, curr = curr, prev
|
||||
}
|
||||
log.Debug().Msgf("Span Range %d::%d", prev, curr)
|
||||
for i := prev + 1; i <= curr; i++ {
|
||||
id, ok := s.GetRowID(i)
|
||||
if !ok {
|
||||
|
|
@ -205,7 +209,7 @@ func (s *SelectTable) markRange(prev, curr int) {
|
|||
break
|
||||
}
|
||||
s.SetSelectedStyle(
|
||||
tcell.ColorBlack,
|
||||
cell.BackgroundColor,
|
||||
cell.Color,
|
||||
tcell.AttrBold,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -98,10 +98,11 @@ func (t *Table) StylesChanged(s *config.Styles) {
|
|||
t.SetBorderColor(s.Table().FgColor.Color())
|
||||
t.SetBorderFocusColor(s.Frame().Border.FocusColor.Color())
|
||||
t.SetSelectedStyle(
|
||||
tcell.ColorBlack,
|
||||
t.styles.Table().CursorColor.Color(),
|
||||
t.styles.Table().CursorFgColor.Color(),
|
||||
t.styles.Table().CursorBgColor.Color(),
|
||||
tcell.AttrBold,
|
||||
)
|
||||
t.fgColor = s.Table().CursorFgColor.Color()
|
||||
t.Refresh()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ func (p *Pulse) Init(ctx context.Context) error {
|
|||
func (p *Pulse) StylesChanged(s *config.Styles) {
|
||||
p.SetBackgroundColor(s.Charts().BgColor.Color())
|
||||
for _, c := range p.charts {
|
||||
c.SetFocusColorNames(s.Table().BgColor.String(), s.Table().CursorColor.String())
|
||||
c.SetFocusColorNames(s.Table().BgColor.String(), s.Table().CursorBgColor.String())
|
||||
if c.IsDial() {
|
||||
c.SetBackgroundColor(s.Charts().DialBgColor.Color())
|
||||
c.SetSeriesColors(s.Charts().DefaultDialColors.Colors()...)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ k9s:
|
|||
table:
|
||||
fgColor: *fg
|
||||
bgColor: *bg
|
||||
cursorColor: *fg
|
||||
cursorBgColor: *fg
|
||||
cursorFgColor: *bg
|
||||
markColor: *mark
|
||||
header:
|
||||
fgColor: *dslate
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ k9s:
|
|||
table:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
cursorColor: *current_line
|
||||
cursorFgColor: *foreground
|
||||
cursorBgColor: *current_line
|
||||
# Header row styles.
|
||||
header:
|
||||
fgColor: *foreground
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ k9s:
|
|||
table:
|
||||
fgColor: *fg
|
||||
bgColor: *bg
|
||||
cursorColor: *aqua
|
||||
cursorFgColor: *fg
|
||||
cursorBgColor: *aqua
|
||||
markColor: *mslate
|
||||
header:
|
||||
fgColor: *fg
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ k9s:
|
|||
table:
|
||||
fgColor: default
|
||||
bgColor: default
|
||||
cursorColor: default
|
||||
cursorFgColor: default
|
||||
cursorBfColor: default
|
||||
header:
|
||||
fgColor: default
|
||||
bgColor: default
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ k9s:
|
|||
table:
|
||||
fgColor: "#57c7ff"
|
||||
bgColor: "#282a36"
|
||||
cursorColor: "#5af78e"
|
||||
cursorFgColor: "#57c7ff"
|
||||
cursorBgColor: "#5af78e"
|
||||
markColor: darkgoldenrod
|
||||
header:
|
||||
fgColor: white
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ k9s:
|
|||
table:
|
||||
fgColor: blue
|
||||
bgColor: black
|
||||
cursorColor: aqua
|
||||
cursorFgColor: black
|
||||
cursorBgColor: aqua
|
||||
markColor: darkgoldenrod
|
||||
header:
|
||||
fgColor: white
|
||||
|
|
|
|||
Loading…
Reference in New Issue