Skip to content

Commit

Permalink
Minor ui update fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gituser143 committed Aug 15, 2020
1 parent 5e1e229 commit 336be63
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/display/process/procGraphs.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,20 @@ func ProcVisuals(endChannel chan os.Signal,
myPage.ChildProcsList.Rows = getChildProcs(data)

on.Do(func() {
// Get Terminal Dimensions adn clear the UI
w, h := ui.TerminalDimensions()
ui.Clear()

// Adjust Memory Stats Bar graph values
myPage.MemStatsChart.BarGap = ((w / 2) - (4 * myPage.MemStatsChart.BarWidth)) / 4

// Adjust Page Faults Bar graph values
myPage.PageFaultsChart.BarGap = ((w / 4) - (2 * myPage.PageFaultsChart.BarWidth)) / 2

// Adjust Context Switches Bar graph values
myPage.CTXSwitchesChart.BarGap = ((w / 4) - (2 * myPage.CTXSwitchesChart.BarWidth)) / 2

// Adjust Grid dimensions
myPage.Grid.SetRect(0, 0, w, h)
ui.Render(myPage.Grid)
})
Expand Down

0 comments on commit 336be63

Please sign in to comment.