diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2018-04-21 21:02:37 -0700 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2018-04-21 21:02:37 -0700 |
commit | 8505b9c2404c5cc39c50fb036bc5e234a42eec25 (patch) | |
tree | 62fa722f0c1a9df92ff4c87635de27eff6bd4c87 /widgets | |
parent | ba84728600e79981d78d6e47d41bff57b555604f (diff) |
Fix column spacing issues1.2.14
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/proc.go | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/widgets/proc.go b/widgets/proc.go index d521fcc..a322b88 100644 --- a/widgets/proc.go +++ b/widgets/proc.go @@ -8,22 +8,15 @@ import ( "time" ui "github.com/cjbassi/termui" - "github.com/mattn/go-runewidth" psCPU "github.com/shirou/gopsutil/cpu" psProc "github.com/shirou/gopsutil/process" ) -var arrowWidth int - const ( UP = "▲" DOWN = "▼" ) -func init() { - arrowWidth = runewidth.StringWidth(UP) -} - // Process represents each process. type Process struct { PID int32 @@ -137,13 +130,7 @@ func (self *Proc) Sort() { func (self *Proc) ColResize() { copy(self.ColWidths, self.DefaultColWidths) - // calculate gap size based on total width self.Gap = 3 - if self.X < 50 { - self.Gap = 1 - } else if self.X < 75 { - self.Gap = 2 - } self.CellXPos = []int{ self.Gap, @@ -163,7 +150,7 @@ func (self *Proc) ColResize() { self.ColWidths[2] = 0 self.ColWidths[3] = 0 } else if self.X < rowWidth { - self.CellXPos[2] = self.CellXPos[3] - 1 + self.CellXPos[2] = self.CellXPos[3] self.ColWidths[3] = 0 } } |