Ticket #1483: mc-4.7.0-pre1.scrollbar.patch

File mc-4.7.0-pre1.scrollbar.patch, 1.3 KB (added by angel_il, 15 years ago)
  • src/screen.c

    diff -Naur mc-4.7.0-pre1~/src/screen.c mc-4.7.0-pre1/src/screen.c
    old new  
    793793} 
    794794 
    795795static void 
     796panel_scrollbar (WPanel *p) 
     797{ 
     798    int line, n = llines(p); 
     799 
     800    if (p->count <= n || slow_terminal) { 
     801        return; 
     802    } 
     803 
     804    line = 2 + n * p->selected / p->count; 
     805#if 0 
     806    /* Are we at the top? */ 
     807    if (p->selected) { 
     808        widget_move (&p->widget, 1, p->widget.cols - 1); 
     809        addch ('^'); 
     810    } 
     811    /* Are we at the bottom? */ 
     812    if (p->selected != p->count - 1) { 
     813        widget_move (&p->widget, n + 2, p->widget.cols - 1); 
     814        addch ('v'); 
     815    } 
     816{ 
     817    int i; 
     818    for (i = 2; i < n + 2; i++) { 
     819        if (i != line) { 
     820            widget_move (&p->widget, i, p->widget.cols - 1); 
     821            addch (0xB0);       /* 0xB0, 0xB1, 0xB2, 0xDB */ 
     822        } 
     823    } 
     824} 
     825#endif 
     826    /* Now draw the nice relative pointer */ 
     827    widget_move (&p->widget, line, p->widget.cols - 1); 
     828    addch ('*');                /* REVERSE, MARKED_COLOR: 0xF9 */ 
     829} 
     830 
     831static void 
    796832show_dir (WPanel *panel) 
    797833{ 
    798834    int len; 
     
    810846        tty_print_alt_char (ACS_RTEE); 
    811847    } 
    812848 
    813     if (panel->active) 
     849    if (panel->active) { 
     850        panel_scrollbar (panel); 
    814851        attrset (REVERSE_COLOR); 
     852    } 
    815853 
    816854    widget_move (&panel->widget, 0, 3); 
    817855