mirror of https://github.com/xzeldon/htop.git
simplify code
This commit is contained in:
parent
9f29e92777
commit
539b32dc31
|
@ -8,21 +8,18 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
|
static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
|
||||||
HandlerResult result = IGNORED;
|
|
||||||
CheckItem* selected = (CheckItem*) Panel_getSelected(this);
|
CheckItem* selected = (CheckItem*) Panel_getSelected(this);
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case KEY_MOUSE:
|
case KEY_MOUSE:
|
||||||
case ' ':
|
case ' ':
|
||||||
CheckItem_set(selected, ! (CheckItem_get(selected)) );
|
CheckItem_set(selected, ! (CheckItem_get(selected)) );
|
||||||
result = HANDLED;
|
return HANDLED;
|
||||||
break;
|
|
||||||
case 0x0a:
|
case 0x0a:
|
||||||
case 0x0d:
|
case 0x0d:
|
||||||
case KEY_ENTER:
|
case KEY_ENTER:
|
||||||
result = BREAK_LOOP;
|
return BREAK_LOOP;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return result;
|
return IGNORED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) {
|
Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) {
|
||||||
|
|
Loading…
Reference in New Issue