Commit 78be8201 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Add expand/collapse on additional clicks!

parent b0036369
...@@ -530,6 +530,7 @@ void Action_setBindings(Htop_Action* keys) { ...@@ -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;
......
...@@ -31,6 +31,7 @@ in the source distribution for its full text. ...@@ -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
......
...@@ -22,6 +22,7 @@ in the source distribution for its full text. ...@@ -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) { ...@@ -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;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment