mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add displayitems override, padding updates to menu
This commit is contained in:
9
menus.go
9
menus.go
@@ -29,6 +29,15 @@ func SortMenu() {
|
||||
m.TextFgColor = ui.ColorWhite
|
||||
m.BorderLabel = "Sort Field"
|
||||
m.BorderFg = ui.ColorCyan
|
||||
|
||||
// set cursor position to current sort field
|
||||
current := GlobalConfig["sortField"]
|
||||
for n, field := range m.Items {
|
||||
if field == current {
|
||||
m.CursorPos = n
|
||||
}
|
||||
}
|
||||
|
||||
ui.Render(m)
|
||||
m.NavigationHandlers()
|
||||
ui.Handle("/sys/kbd/<enter>", func(ui.Event) {
|
||||
|
||||
Reference in New Issue
Block a user