diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2022-10-20 15:03:17 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2022-10-22 17:42:19 +0200 |
commit | 15fe50d272a5f548c7b9a0b8e79794fe1caf31bc (patch) | |
tree | a27749d593aacd3d75a22c1154c354cc8958d2a9 /Action.c | |
parent | d83948ed09039864cdaf6066a1bd64476211ecaa (diff) |
Toggle the header meters with pound key
Show/hide the header meters with the pound ('#') key. Useful in cases
where the header is too large and occupies essential parts of the
screen, especially in settings (see #1108).
It is only stored as a runtime state, not a persistent setting; to
remove the header permanently one can delete all active meters.
Diffstat (limited to 'Action.c')
-rw-r--r-- | Action.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -245,6 +245,11 @@ static Htop_Reaction actionToggleTreeView(State* st) { return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR; } +static Htop_Reaction actionToggleHideMeters(State* st) { + st->hideMeters = !st->hideMeters; + return HTOP_RESIZE | HTOP_KEEP_FOLLOWING; +} + static Htop_Reaction actionExpandOrCollapseAllBranches(State* st) { ScreenSettings* ss = st->settings->ss; if (!ss->treeView) { @@ -514,6 +519,7 @@ static const struct { bool roInactive; const char* info; } helpLeft[] = { + { .key = " #: ", .roInactive = false, .info = "hide/show header meters" }, { .key = " Tab: ", .roInactive = false, .info = "switch to next screen tab" }, { .key = " Arrows: ", .roInactive = false, .info = "scroll process list" }, { .key = " Digits: ", .roInactive = false, .info = "incremental PID search" }, @@ -740,6 +746,7 @@ static Htop_Reaction actionShowCommandScreen(State* st) { void Action_setBindings(Htop_Action* keys) { keys[' '] = actionTag; + keys['#'] = actionToggleHideMeters; keys['*'] = actionExpandOrCollapseAllBranches; keys['+'] = actionExpandOrCollapse; keys[','] = actionSetSortColumn; |