mirror of https://github.com/xzeldon/htop.git
Add expand/collapse on additional clicks!
This commit is contained in:
parent
b003636958
commit
78be8201dc
1
Action.c
1
Action.c
|
@ -530,6 +530,7 @@ void Action_setBindings(Htop_Action* keys) {
|
||||||
keys['a'] = actionSetAffinity;
|
keys['a'] = actionSetAffinity;
|
||||||
keys[KEY_F(9)] = actionKill;
|
keys[KEY_F(9)] = actionKill;
|
||||||
keys['k'] = actionKill;
|
keys['k'] = actionKill;
|
||||||
|
keys[KEY_RECLICK] = actionExpandOrCollapse;
|
||||||
keys['+'] = actionExpandOrCollapse;
|
keys['+'] = actionExpandOrCollapse;
|
||||||
keys['='] = actionExpandOrCollapse;
|
keys['='] = actionExpandOrCollapse;
|
||||||
keys['-'] = actionExpandOrCollapse;
|
keys['-'] = actionExpandOrCollapse;
|
||||||
|
|
1
CRT.c
1
CRT.c
|
@ -31,6 +31,7 @@ in the source distribution for its full text.
|
||||||
|
|
||||||
#define KEY_WHEELUP KEY_F(20)
|
#define KEY_WHEELUP KEY_F(20)
|
||||||
#define KEY_WHEELDOWN KEY_F(21)
|
#define KEY_WHEELDOWN KEY_F(21)
|
||||||
|
#define KEY_RECLICK KEY_F(22)
|
||||||
|
|
||||||
//#link curses
|
//#link curses
|
||||||
|
|
||||||
|
|
1
CRT.h
1
CRT.h
|
@ -22,6 +22,7 @@ in the source distribution for its full text.
|
||||||
|
|
||||||
#define KEY_WHEELUP KEY_F(20)
|
#define KEY_WHEELUP KEY_F(20)
|
||||||
#define KEY_WHEELDOWN KEY_F(21)
|
#define KEY_WHEELDOWN KEY_F(21)
|
||||||
|
#define KEY_RECLICK KEY_F(22)
|
||||||
|
|
||||||
//#link curses
|
//#link curses
|
||||||
|
|
||||||
|
|
|
@ -208,12 +208,16 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
|
||||||
ch = EVENT_HEADER_CLICK(mevent.x - panel->x);
|
ch = EVENT_HEADER_CLICK(mevent.x - panel->x);
|
||||||
break;
|
break;
|
||||||
} else if (mevent.y > panel->y && mevent.y <= panel->y+panel->h) {
|
} else if (mevent.y > panel->y && mevent.y <= panel->y+panel->h) {
|
||||||
|
ch = KEY_MOUSE;
|
||||||
if (panel == panelFocus || this->allowFocusChange) {
|
if (panel == panelFocus || this->allowFocusChange) {
|
||||||
focus = i;
|
focus = i;
|
||||||
panelFocus = setCurrentPanel(panel);
|
panelFocus = setCurrentPanel(panel);
|
||||||
|
Object* oldSelection = Panel_getSelected(panel);
|
||||||
Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
|
Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
|
||||||
|
if (Panel_getSelected(panel) == oldSelection) {
|
||||||
|
ch = KEY_RECLICK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ch = KEY_MOUSE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue