mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-11-29 10:04:18 +01:00
bug: ensure avg cpu is drawn on top in "All" mode (#1859)
* bug: ensure avg cpu is drawn on top * changelog
This commit is contained in:
parent
f5f157707c
commit
0735276122
10
CHANGELOG.md
10
CHANGELOG.md
@ -24,6 +24,16 @@ That said, these are more guidelines rather than hardset rules, though the proje
|
|||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- [#1859](https://github.com/ClementTsang/bottom/pull/1859): Ensure average CPU is drawn on top in "All" mode.
|
||||||
|
|
||||||
|
### Other
|
||||||
|
|
||||||
|
## [0.11.3] - 2025-11-06
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
- [#1812](https://github.com/ClementTsang/bottom/pull/1812): Add `free_arc` option to subtract ARC from total memory usage.
|
- [#1812](https://github.com/ClementTsang/bottom/pull/1812): Add `free_arc` option to subtract ARC from total memory usage.
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@ -132,10 +132,8 @@ impl Painter {
|
|||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(itx, values)| {
|
.map(|(itx, values)| {
|
||||||
let style = if show_avg_cpu && itx == AVG_POSITION {
|
let style = if show_avg_cpu && itx == 0 {
|
||||||
self.styles.avg_cpu_colour
|
self.styles.avg_cpu_colour
|
||||||
} else if itx == ALL_POSITION {
|
|
||||||
self.styles.all_cpu_colour
|
|
||||||
} else {
|
} else {
|
||||||
self.styles.cpu_colour_styles
|
self.styles.cpu_colour_styles
|
||||||
[(itx - show_avg_offset) % self.styles.cpu_colour_styles.len()]
|
[(itx - show_avg_offset) % self.styles.cpu_colour_styles.len()]
|
||||||
@ -147,6 +145,7 @@ impl Painter {
|
|||||||
.collect()
|
.collect()
|
||||||
} else if let Some(CpuData { .. }) = cpu_entries.get(current_scroll_position - 1) {
|
} else if let Some(CpuData { .. }) = cpu_entries.get(current_scroll_position - 1) {
|
||||||
// We generally subtract one from current scroll position because of the all entry.
|
// We generally subtract one from current scroll position because of the all entry.
|
||||||
|
// TODO: Do this a bit better (e.g. we can just do if let Some(_) = cpu_points.get())
|
||||||
|
|
||||||
let style = if show_avg_cpu && current_scroll_position == AVG_POSITION {
|
let style = if show_avg_cpu && current_scroll_position == AVG_POSITION {
|
||||||
self.styles.avg_cpu_colour
|
self.styles.avg_cpu_colour
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user