|
@@ -444,6 +444,7 @@ static void init_widget ( struct setting_widget *widget,
|
444
|
444
|
static int main_loop ( struct settings *settings ) {
|
445
|
445
|
struct setting_widget widget;
|
446
|
446
|
int redraw = 1;
|
|
447
|
+ int move;
|
447
|
448
|
unsigned int next;
|
448
|
449
|
int key;
|
449
|
450
|
int rc;
|
|
@@ -497,15 +498,15 @@ static int main_loop ( struct settings *settings ) {
|
497
|
498
|
|
498
|
499
|
/* Process keypress */
|
499
|
500
|
key = getkey ( 0 );
|
500
|
|
- next = widget.current;
|
|
501
|
+ move = 0;
|
501
|
502
|
switch ( key ) {
|
502
|
503
|
case KEY_DOWN:
|
503
|
504
|
if ( widget.current < ( widget.num_rows - 1 ) )
|
504
|
|
- next++;
|
|
505
|
+ move = +1;
|
505
|
506
|
break;
|
506
|
507
|
case KEY_UP:
|
507
|
508
|
if ( widget.current > 0 )
|
508
|
|
- next--;
|
|
509
|
+ move = -1;
|
509
|
510
|
break;
|
510
|
511
|
case CTRL_D:
|
511
|
512
|
if ( ! widget.row.setting )
|
|
@@ -534,7 +535,8 @@ static int main_loop ( struct settings *settings ) {
|
534
|
535
|
}
|
535
|
536
|
break;
|
536
|
537
|
}
|
537
|
|
- if ( next != widget.current ) {
|
|
538
|
+ if ( move ) {
|
|
539
|
+ next = ( widget.current + move );
|
538
|
540
|
draw_setting_row ( &widget );
|
539
|
541
|
redraw = 1;
|
540
|
542
|
reveal_setting_row ( &widget, next );
|