mirror of
https://github.com/bcicen/ctop.git
synced 2025-11-18 00:40:37 +01:00
use GridBufferer as rows in CompactGrid
This commit is contained in:
@@ -13,15 +13,19 @@ type CompactHeader struct {
|
||||
|
||||
func NewCompactHeader() *CompactHeader {
|
||||
fields := []string{"", "NAME", "CID", "CPU", "MEM", "NET RX/TX"}
|
||||
header := &CompactHeader{}
|
||||
header := &CompactHeader{Height: 2}
|
||||
for _, f := range fields {
|
||||
header.pars = append(header.pars, headerPar(f))
|
||||
}
|
||||
return header
|
||||
}
|
||||
|
||||
func (c *CompactHeader) GetHeight() int {
|
||||
return c.Height
|
||||
}
|
||||
|
||||
func (c *CompactHeader) SetWidth(w int) {
|
||||
x := 1
|
||||
x := c.X
|
||||
autoWidth := calcWidth(w, 5)
|
||||
for n, col := range c.pars {
|
||||
// set status column to static width
|
||||
@@ -38,6 +42,10 @@ func (c *CompactHeader) SetWidth(w int) {
|
||||
c.Width = w
|
||||
}
|
||||
|
||||
func (c *CompactHeader) SetX(x int) {
|
||||
c.X = x
|
||||
}
|
||||
|
||||
func (c *CompactHeader) SetY(y int) {
|
||||
for _, p := range c.pars {
|
||||
p.SetY(y)
|
||||
|
||||
Reference in New Issue
Block a user