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{
|
&Switch{
|
||||||
Key: "sortReversed",
|
Key: "sortReversed",
|
||||||
Val: false,
|
Val: false,
|
||||||
Label: "Reverse Sort Order",
|
Label: "Reverse sort order",
|
||||||
},
|
},
|
||||||
&Switch{
|
&Switch{
|
||||||
Key: "allContainers",
|
Key: "allContainers",
|
||||||
Val: true,
|
Val: true,
|
||||||
Label: "Show All Containers",
|
Label: "Show all containers",
|
||||||
|
},
|
||||||
|
&Switch{
|
||||||
|
Key: "fullRowCursor",
|
||||||
|
Val: true,
|
||||||
|
Label: "Highlight entire cursor row (vs. name only)",
|
||||||
},
|
},
|
||||||
&Switch{
|
&Switch{
|
||||||
Key: "enableHeader",
|
Key: "enableHeader",
|
||||||
Val: true,
|
Val: true,
|
||||||
Label: "Enable Status Header",
|
Label: "Enable status header",
|
||||||
},
|
},
|
||||||
&Switch{
|
&Switch{
|
||||||
Key: "scaleCpu",
|
Key: "scaleCpu",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package compact
|
package compact
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/bcicen/ctop/config"
|
||||||
"github.com/bcicen/ctop/logging"
|
"github.com/bcicen/ctop/logging"
|
||||||
"github.com/bcicen/ctop/models"
|
"github.com/bcicen/ctop/models"
|
||||||
ui "github.com/gizak/termui"
|
ui "github.com/gizak/termui"
|
||||||
@ -153,25 +154,29 @@ func (row *Compact) all() []ui.GridBufferer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (row *Compact) Highlight() {
|
func (row *Compact) Highlight() {
|
||||||
row.Bg.Highlight()
|
|
||||||
row.Name.Highlight()
|
row.Name.Highlight()
|
||||||
|
if config.GetSwitchVal("fullRowCursor") {
|
||||||
|
row.Bg.Highlight()
|
||||||
row.Cid.Highlight()
|
row.Cid.Highlight()
|
||||||
row.Cpu.Highlight()
|
row.Cpu.Highlight()
|
||||||
row.Mem.Highlight()
|
row.Mem.Highlight()
|
||||||
row.Net.Highlight()
|
row.Net.Highlight()
|
||||||
row.IO.Highlight()
|
row.IO.Highlight()
|
||||||
row.Pids.Highlight()
|
row.Pids.Highlight()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (row *Compact) UnHighlight() {
|
func (row *Compact) UnHighlight() {
|
||||||
row.Bg.UnHighlight()
|
|
||||||
row.Name.UnHighlight()
|
row.Name.UnHighlight()
|
||||||
|
if config.GetSwitchVal("fullRowCursor") {
|
||||||
|
row.Bg.UnHighlight()
|
||||||
row.Cid.UnHighlight()
|
row.Cid.UnHighlight()
|
||||||
row.Cpu.UnHighlight()
|
row.Cpu.UnHighlight()
|
||||||
row.Mem.UnHighlight()
|
row.Mem.UnHighlight()
|
||||||
row.Net.UnHighlight()
|
row.Net.UnHighlight()
|
||||||
row.IO.UnHighlight()
|
row.IO.UnHighlight()
|
||||||
row.Pids.UnHighlight()
|
row.Pids.UnHighlight()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type RowBg struct {
|
type RowBg struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user