mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add config toggle for full-row cursor
This commit is contained in:
parent
cf352f7c8a
commit
caf6fc63c1
@ -5,17 +5,22 @@ var switches = []*Switch{
|
||||
&Switch{
|
||||
Key: "sortReversed",
|
||||
Val: false,
|
||||
Label: "Reverse Sort Order",
|
||||
Label: "Reverse sort order",
|
||||
},
|
||||
&Switch{
|
||||
Key: "allContainers",
|
||||
Val: true,
|
||||
Label: "Show All Containers",
|
||||
Label: "Show all containers",
|
||||
},
|
||||
&Switch{
|
||||
Key: "fullRowCursor",
|
||||
Val: true,
|
||||
Label: "Highlight entire cursor row (vs. name only)",
|
||||
},
|
||||
&Switch{
|
||||
Key: "enableHeader",
|
||||
Val: true,
|
||||
Label: "Enable Status Header",
|
||||
Label: "Enable status header",
|
||||
},
|
||||
&Switch{
|
||||
Key: "scaleCpu",
|
||||
|
@ -1,6 +1,7 @@
|
||||
package compact
|
||||
|
||||
import (
|
||||
"github.com/bcicen/ctop/config"
|
||||
"github.com/bcicen/ctop/logging"
|
||||
"github.com/bcicen/ctop/models"
|
||||
ui "github.com/gizak/termui"
|
||||
@ -153,25 +154,29 @@ func (row *Compact) all() []ui.GridBufferer {
|
||||
}
|
||||
|
||||
func (row *Compact) Highlight() {
|
||||
row.Bg.Highlight()
|
||||
row.Name.Highlight()
|
||||
row.Cid.Highlight()
|
||||
row.Cpu.Highlight()
|
||||
row.Mem.Highlight()
|
||||
row.Net.Highlight()
|
||||
row.IO.Highlight()
|
||||
row.Pids.Highlight()
|
||||
if config.GetSwitchVal("fullRowCursor") {
|
||||
row.Bg.Highlight()
|
||||
row.Cid.Highlight()
|
||||
row.Cpu.Highlight()
|
||||
row.Mem.Highlight()
|
||||
row.Net.Highlight()
|
||||
row.IO.Highlight()
|
||||
row.Pids.Highlight()
|
||||
}
|
||||
}
|
||||
|
||||
func (row *Compact) UnHighlight() {
|
||||
row.Bg.UnHighlight()
|
||||
row.Name.UnHighlight()
|
||||
row.Cid.UnHighlight()
|
||||
row.Cpu.UnHighlight()
|
||||
row.Mem.UnHighlight()
|
||||
row.Net.UnHighlight()
|
||||
row.IO.UnHighlight()
|
||||
row.Pids.UnHighlight()
|
||||
if config.GetSwitchVal("fullRowCursor") {
|
||||
row.Bg.UnHighlight()
|
||||
row.Cid.UnHighlight()
|
||||
row.Cpu.UnHighlight()
|
||||
row.Mem.UnHighlight()
|
||||
row.Net.UnHighlight()
|
||||
row.IO.UnHighlight()
|
||||
row.Pids.UnHighlight()
|
||||
}
|
||||
}
|
||||
|
||||
type RowBg struct {
|
||||
|
Loading…
Reference in New Issue
Block a user