diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-01-28 04:09:06 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-17 15:30:15 -0200 |
commit | 187a035a769fb490318091fee2b0051d9b188ad5 (patch) | |
tree | ad74fe0bfe51adb320f2f2bbb8ce45fcd335f960 /MainPanel.c | |
parent | ece89b8df0db61b8caaf53679afbe00e1c2ef22f (diff) |
Add support for multiple screens, switchable using Tab
Diffstat (limited to 'MainPanel.c')
-rw-r--r-- | MainPanel.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/MainPanel.c b/MainPanel.c index b5a7e305..4366792b 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -67,15 +67,17 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { Htop_Reaction reaction = HTOP_OK; + Settings* settings = this->state->settings; + ScreenSettings* ss = settings->ss; + if (EVENT_IS_HEADER_CLICK(ch)) { int x = EVENT_HEADER_CLICK_GET_X(ch); ProcessList* pl = this->state->pl; - Settings* settings = this->state->settings; int hx = super->scrollH + x + 1; ProcessField field = ProcessList_keyAt(pl, hx); - if (field == settings->sortKey) { - Settings_invertSortOrder(settings); - settings->treeView = false; + if (field == ss->sortKey) { + ScreenSettings_invertSortOrder(ss); + ss->treeView = false; } else { reaction |= Action_setSortKey(settings, field); } @@ -108,8 +110,8 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { } if (reaction & HTOP_REDRAW_BAR) { - MainPanel_updateTreeFunctions(this, this->state->settings->treeView); - IncSet_drawBar(this->inc); + MainPanel_updateTreeFunctions(this, settings->ss->treeView); + IncSet_drawBar(this->inc, CRT_colors[FUNCTION_BAR]); } if (reaction & HTOP_UPDATE_PANELHDR) { ProcessList_printHeader(this->state->pl, Panel_getHeader(super)); |