Make column operation more comfortable.

This commit is contained in:
Hisham Muhammad 2008-03-09 07:42:19 +00:00
parent 8fa33dc336
commit 460608d6e2
1 changed files with 2 additions and 3 deletions

View File

@ -59,10 +59,9 @@ HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
case KEY_ENTER:
case KEY_F(5):
{
int at = Panel_getSelectedIndex(this->columns) + 1;
if (at == Panel_getSize(this->columns))
at--;
int at = Panel_getSelectedIndex(this->columns);
Panel_insert(this->columns, at, (Object*) ListItem_new(text, 0));
Panel_setSelected(this->columns, at+1);
ColumnsPanel_update(this->columns);
result = HANDLED;
break;