Ticket #1564: wheel_on_panel.diff

File wheel_on_panel.diff, 707 bytes (added by dmartina, 10 years ago)

Smooth wheel movement on file panels

  • src/screen.c

    diff -ur mc.git/src/screen.c mc.gpm/src/screen.c
    old new  
    25472547 
    25482548    /* Mouse wheel events */ 
    25492549    if ((event->buttons & GPM_B_UP) && (event->type & GPM_DOWN)) { 
    2550         prev_page (panel); 
     2550        if ( panel->top_file > 0 ) 
     2551            prev_page (panel); 
     2552        else                    /* We are in first page */ 
     2553            move_up (panel); 
    25512554        return MOU_NORMAL; 
    25522555    } 
    25532556    if ((event->buttons & GPM_B_DOWN) && (event->type & GPM_DOWN)) { 
    2554         next_page (panel); 
     2557        if ( panel->top_file + lines < panel->count ) 
     2558            next_page (panel); 
     2559        else                    /* We are in last page */ 
     2560            move_down (panel); 
    25552561        return MOU_NORMAL; 
    25562562    }