mirror of https://github.com/xzeldon/htop.git
ignore enter, delete and space on empty panel
This commit is contained in:
parent
abe165fe5c
commit
b796362e90
|
@ -76,6 +76,8 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
|
||||||
case 0x0d:
|
case 0x0d:
|
||||||
case KEY_ENTER:
|
case KEY_ENTER:
|
||||||
{
|
{
|
||||||
|
if (!Vector_size(this->meters))
|
||||||
|
break;
|
||||||
this->moving = !(this->moving);
|
this->moving = !(this->moving);
|
||||||
((ListItem*)Panel_getSelected(super))->moving = this->moving;
|
((ListItem*)Panel_getSelected(super))->moving = this->moving;
|
||||||
result = HANDLED;
|
result = HANDLED;
|
||||||
|
@ -85,6 +87,8 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
|
||||||
case KEY_F(4):
|
case KEY_F(4):
|
||||||
case 't':
|
case 't':
|
||||||
{
|
{
|
||||||
|
if (!Vector_size(this->meters))
|
||||||
|
break;
|
||||||
Meter* meter = (Meter*) Vector_get(this->meters, selected);
|
Meter* meter = (Meter*) Vector_get(this->meters, selected);
|
||||||
int mode = meter->mode + 1;
|
int mode = meter->mode + 1;
|
||||||
if (mode == LAST_METERMODE) mode = 1;
|
if (mode == LAST_METERMODE) mode = 1;
|
||||||
|
@ -147,6 +151,8 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
|
||||||
case KEY_F(9):
|
case KEY_F(9):
|
||||||
case KEY_DC:
|
case KEY_DC:
|
||||||
{
|
{
|
||||||
|
if (!Vector_size(this->meters))
|
||||||
|
break;
|
||||||
if (selected < Vector_size(this->meters)) {
|
if (selected < Vector_size(this->meters)) {
|
||||||
Vector_remove(this->meters, selected);
|
Vector_remove(this->meters, selected);
|
||||||
Panel_remove(super, selected);
|
Panel_remove(super, selected);
|
||||||
|
|
Loading…
Reference in New Issue