simplification in wmiimenu.c

This commit is contained in:
Sander van Dijk 2006-07-05 19:07:00 +00:00
parent def86fc6bb
commit 110f89587e
1 changed files with 12 additions and 14 deletions

View File

@ -264,6 +264,10 @@ handle_kpress(XKeyEvent * e)
if(!(sel && sel->left)) if(!(sel && sel->left))
return; return;
sel=sel->left; sel=sel->left;
if(sel->right == curroff) {
curroff = prevoff;
update_offsets();
}
break; break;
case XK_Tab: case XK_Tab:
if(!sel) if(!sel)
@ -275,6 +279,10 @@ handle_kpress(XKeyEvent * e)
if(!(sel && sel->right)) if(!(sel && sel->right))
return; return;
sel=sel->right; sel=sel->right;
if(sel == nextoff) {
curroff = nextoff;
update_offsets();
}
break; break;
case XK_Return: case XK_Return:
if(e->state & ShiftMask) { if(e->state & ShiftMask) {
@ -312,15 +320,6 @@ handle_kpress(XKeyEvent * e)
update_items(text); update_items(text);
} }
} }
if(sel) {
if(curroff && sel == curroff->left) {
curroff = prevoff;
update_offsets();
} else if(sel == nextoff) {
curroff = nextoff;
update_offsets();
}
}
draw_menu(); draw_menu();
} }
@ -346,12 +345,11 @@ read_allitems()
new = cext_emalloc(sizeof(Item)); new = cext_emalloc(sizeof(Item));
new->next = new->left = new->right = nil; new->next = new->left = new->right = nil;
new->text = p; new->text = p;
if(!allitem) if(!i)
allitem = i = new; allitem = new;
else { else
i->next = new; i->next = new;
i = new; i = new;
}
} }
return maxname; return maxname;