Lister: upgrade scrollbar style in text mode

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Lister: upgrade scrollbar style in text mode

Post by *Slavic »

Current look of Lister's scrollbar in the text and hex modes reminds the old good times of Windows 3.1. Its scroll box (sometimes called a thumb) has the fixed size similar to buttons at the ends of the scrollbar. Contrary, scrollbars built in the TC panels and Lister's scrollbars for pictures have more contemporary look.

I guess that it's a result of the old TC heritage. Maybe fixing this part of code wouldn't be too hard. Besides the consistent look of scrollbars in different areas, the modern scrollbar is much more handy and informative than the old one, text viewing is not an exemption.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Lister: upgrade scrollbar style in text mode

Post by *ghisler(Author) »

No, the reason is different: Lister doesn't know how many lines a file has. It would have to read the entire file just to get that information. But this information would be needed to show a thumb button with a size proportional to the currently shown part of the file. Instead, when you use the thumb button, Lister scrolls to the percentage of the position. For example, when you move the thumb button to 30% down, Lister scrolls to 30% of the length of the file.
Author of Total Commander
https://www.ghisler.com
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Re: Lister: upgrade scrollbar style in text mode

Post by *Slavic »

Yes, I understand the logics: generally, Lister doesn't read the entire file, unlike all text editors do, so it cannot calculate the part of the text shown on the Lister's screen. So, keeping the current scrollbar look may be reasonable.

However, I see two possible exceptions:
1. If the file is not large and Lister may read it whole to the internal buffer, so the number of the text lines can be calculated;
2. Lister is in hex (binary) mode, when the part of the file shown on the screen is known and isn't changed while scrolling, even for large file.

For such files or viewing mode the modern scrollbar would be nice to have, if it will not require too much changes in the code.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Lister: upgrade scrollbar style in text mode

Post by *Usher »

Slavic wrote: 2021-05-11, 10:06 UTC Lister doesn't read the entire file, unlike all text editors do
Wrong. Unlike many text editors do. See for example this article: https://www.ghacks.net/2018/02/22/how-to-open-gigabyte-sized-text-files-on-windows/
Andrzej P. Wozniak
Polish subforum moderator
Post Reply