aboutsummaryrefslogtreecommitdiffstats
path: root/MainPanel.c
diff options
context:
space:
mode:
Diffstat (limited to 'MainPanel.c')
-rw-r--r--MainPanel.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/MainPanel.c b/MainPanel.c
index 07dc631..44915df 100644
--- a/MainPanel.c
+++ b/MainPanel.c
@@ -24,9 +24,10 @@ in the source distribution for its full text.
static const char* const MainFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL};
static const char* const MainFunctions_ro[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", " ", " ", " ", "Quit ", NULL};
-void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) {
+void MainPanel_updateLabels(MainPanel* this, bool list, bool filter) {
FunctionBar* bar = MainPanel_getFunctionBar(this);
- FunctionBar_setLabel(bar, KEY_F(5), mode ? "List " : "Tree ");
+ FunctionBar_setLabel(bar, KEY_F(5), list ? "List " : "Tree ");
+ FunctionBar_setLabel(bar, KEY_F(4), filter ? "FILTER" : "Filter");
}
static void MainPanel_pidSearch(MainPanel* this, int ch) {
@@ -71,23 +72,29 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
if (needReset)
this->state->hideProcessSelection = false;
+ Settings* settings = this->state->settings;
+ ScreenSettings* ss = settings->ss;
+
if (EVENT_IS_HEADER_CLICK(ch)) {
int x = EVENT_HEADER_CLICK_GET_X(ch);
const ProcessList* pl = this->state->pl;
- Settings* settings = this->state->settings;
int hx = super->scrollH + x + 1;
ProcessField field = ProcessList_keyAt(pl, hx);
- if (settings->treeView && settings->treeViewAlwaysByPID) {
- settings->treeView = false;
- settings->direction = 1;
+ if (ss->treeView && ss->treeViewAlwaysByPID) {
+ ss->treeView = false;
+ ss->direction = 1;
reaction |= Action_setSortKey(settings, field);
- } else if (field == Settings_getActiveSortKey(settings)) {
- Settings_invertSortOrder(settings);
+ } else if (field == ScreenSettings_getActiveSortKey(ss)) {
+ ScreenSettings_invertSortOrder(ss);
} else {
reaction |= Action_setSortKey(settings, field);
}
reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_SAVE_SETTINGS;
result = HANDLED;
+ } else if (EVENT_IS_SCREEN_TAB_CLICK(ch)) {
+ int x = EVENT_SCREEN_TAB_GET_X(ch);
+ reaction |= Action_setScreenTab(settings, x);
+ result = HANDLED;
} else if (ch != ERR && this->inc->active) {
bool filterChanged = IncSet_handleKey(this->inc, ch, super, MainPanel_getValue, NULL);
if (filterChanged) {
@@ -116,7 +123,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
}
if (reaction & HTOP_REDRAW_BAR) {
- MainPanel_updateTreeFunctions(this, this->state->settings->treeView);
+ MainPanel_updateLabels(this, settings->ss->treeView, this->state->pl->incFilter);
}
if (reaction & HTOP_RESIZE) {
result |= RESIZE;
@@ -182,7 +189,7 @@ static void MainPanel_drawFunctionBar(Panel* super, bool hideFunctionBar) {
if (hideFunctionBar && !this->inc->active)
return;
- IncSet_drawBar(this->inc);
+ IncSet_drawBar(this->inc, CRT_colors[FUNCTION_BAR]);
if (this->state->pauseProcessUpdate) {
FunctionBar_append("PAUSED", CRT_colors[PAUSED]);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy