Add expand/collapse on additional clicks!

This commit is contained in:
Hisham Muhammad 2015-08-19 19:09:54 -03:00
parent b003636958
commit 78be8201dc
4 changed files with 8 additions and 1 deletions

View File

@ -530,6 +530,7 @@ void Action_setBindings(Htop_Action* keys) {
keys['a'] = actionSetAffinity;
keys[KEY_F(9)] = actionKill;
keys['k'] = actionKill;
keys[KEY_RECLICK] = actionExpandOrCollapse;
keys['+'] = actionExpandOrCollapse;
keys['='] = actionExpandOrCollapse;
keys['-'] = actionExpandOrCollapse;

1
CRT.c
View File

@ -31,6 +31,7 @@ in the source distribution for its full text.
#define KEY_WHEELUP KEY_F(20)
#define KEY_WHEELDOWN KEY_F(21)
#define KEY_RECLICK KEY_F(22)
//#link curses

1
CRT.h
View File

@ -22,6 +22,7 @@ in the source distribution for its full text.
#define KEY_WHEELUP KEY_F(20)
#define KEY_WHEELDOWN KEY_F(21)
#define KEY_RECLICK KEY_F(22)
//#link curses

View File

@ -208,12 +208,16 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
ch = EVENT_HEADER_CLICK(mevent.x - panel->x);
break;
} else if (mevent.y > panel->y && mevent.y <= panel->y+panel->h) {
ch = KEY_MOUSE;
if (panel == panelFocus || this->allowFocusChange) {
focus = i;
panelFocus = setCurrentPanel(panel);
Object* oldSelection = Panel_getSelected(panel);
Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
if (Panel_getSelected(panel) == oldSelection) {
ch = KEY_RECLICK;
}
}
ch = KEY_MOUSE;
break;
}
}