bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [PATCH] Make the marquee a proper marquee


From: Darshit Shah
Subject: Re: [Bug-wget] [PATCH] Make the marquee a proper marquee
Date: Wed, 24 Jun 2015 13:36:23 +0530

Hi Alex,

Thanks for the patch! The quick loop around was indeed an eye-sore.

However, with you patch, the filename starts scrolling from the right
end one character at a time. This is again painful, since it takes
about 15 seconds to fill the buffer.

Could we start with 15 columns worth of the filename in the buffer and
then follow the marquee format that you proposed? That allows the user
to get a lot more information very quickly.

On Wed, Jun 24, 2015 at 3:22 AM, Alex Henrie <address@hidden> wrote:
> This patch gives the user plenty of time to see the beginning and the
> end of the filename before the edge scrolls out of view.
> ---
>  src/progress.c | 23 +++++++++++++++++++----
>  1 file changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/src/progress.c b/src/progress.c
> index 465bebf..5d3cdc0 100644
> --- a/src/progress.c
> +++ b/src/progress.c
> @@ -967,16 +967,31 @@ create_image (struct bar_progress *bp, double 
> dl_total_time, bool done)
>        if ((orig_filename_cols > MAX_FILENAME_COLS + MIN_SCROLL_TEXT) &&
>            !opt.noscroll &&
>            !done)
> -        offset_cols = ((int) bp->tick) % (orig_filename_cols - 
> MAX_FILENAME_COLS + 1);
> +        {
> +          offset_cols = ((int) bp->tick + orig_filename_cols + 1)
> +                        % (orig_filename_cols + MAX_FILENAME_COLS);
> +          if (offset_cols > orig_filename_cols)
> +            {
> +              padding = MAX_FILENAME_COLS - (offset_cols - 
> orig_filename_cols);
> +              memset(p, ' ', padding);
> +              p += padding;
> +              offset_cols = 0;
> +            }
> +          else
> +            padding = 0;
> +        }
>        else
> -        offset_cols = 0;
> +        {
> +          padding = 0;
> +          offset_cols = 0;
> +        }
>        offset_bytes = cols_to_bytes (bp->f_download, offset_cols, cols_ret);
>        bytes_in_filename = cols_to_bytes (bp->f_download + offset_bytes,
> -                                         MAX_FILENAME_COLS,
> +                                         MAX_FILENAME_COLS - padding,
>                                           cols_ret);
>        memcpy (p, bp->f_download + offset_bytes, bytes_in_filename);
>        p += bytes_in_filename;
> -      padding = MAX_FILENAME_COLS - *cols_ret;
> +      padding = MAX_FILENAME_COLS - (padding + *cols_ret);
>        for (;padding;padding--)
>            *p++ = ' ';
>        *p++ = ' ';
> --
> 2.4.4
>
>



-- 
Thanking You,
Darshit Shah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]