TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

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

TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *Slavic »

Lister can now zoom the image, but initial size is always shown on the right part of top menu as 100%, even when we set an option "Fit image to window" or "Fit only larger images to window". However, if the image is scaled, it cannot be 100% and the real percent of zoom should be shown instead.
Also changing the zoom works differently:
a) Changing zoom by key/mouse cancels fit to window and clears the check mark in menu.
b) Changing by size dialog does not cancel fit, check mark in menu remains.

How to reproduce:
1) Choose a large picture for test, e.g. from digital camera (I used 3840x2160).
2) Open it in Lister for view (it should be shown with 100% size by default) and select "Fit image to window" in menu Options. Picture fits, but the zoom is shown 100% as initially.
3) Use Ctrl+wheel to change the zoom. Picture is resized properly and real zoom is shown (like 20%, 25% etc). Now it doesn't fit to window and check mark in "Fit image to window" menu item is cleared, as expected.
4) Open the image in Lister again (it is shown with 100% size as before), select "Fit image to window". It fits, zoom is shown 100% (the same error). Now click on 100% and input 20 in the size dialog. Image is resized correctly, but the mark in "Fit image to window" menu remains. This is inconsistent, it should be cleared as above.
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: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *ghisler(Author) »

Sorry, this isn't planned. Why? Because I would have to constantly update the value then when you resize the window, which would cause horrible flickering and may even result in infinite loops when the zoom factor change results in a 2 line menu bar with one value and 1 line with the other.
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: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *Slavic »

I understand this problem. Sure, infinite loop should be prevented at all cost and flickering as well...

Can it be fixed in other way? For example, until the mode "Fit to window" is active, the text "100%" may be hidden at all or somehow replaced, e.g. with "Zoom". So, we will not see the wrong zoom info and it will not be constantly recalculated at resize; on the other side, if user selects a fixed zoom, the value will be shown as now. It's one possible way, may be some others.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
siealex
Senior Member
Senior Member
Posts: 278
Joined: 2009-03-22, 16:36 UTC

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *siealex »

Because I would have to constantly update the value then when you resize the window
Why can't it be updated AFTER resizing, e. g. one second later?
We are not so S.M.A.R.T. as we imagine...
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *Usher »

siealex wrote: 2022-04-22, 20:22 UTC
Because I would have to constantly update the value then when you resize the window
Why can't it be updated AFTER resizing, e. g. one second later?
...and show "Resizing..." while resizing? ;-)
Andrzej P. Wozniak
Polish subforum moderator
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *AntonyD »

2*ghisler(Author)
Because I would have to constantly update the value then when you resize the window
Nothing needs to be constantly redrawn and updated. It is always enough to do it once AFTER the end of any long-term action. If I choose the zoom scale, then obviously I will do it slower than my computer can process these commands. This means that there will be almost no load on the program for drawing the current values. It will have time to do everything without any problems - and change the scale and show a new number of this scale.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *ghisler(Author) »

Imagine this:
1. You resize the window
-> the zoom factor changes
2. TC shows the new zoom factor in the title bar, which changes the width of the menu item
-> the menu bar becomes too wide, so it's now displayed on two lines
-> the zoom factor changes
3. TC shows the new zoom factor in the title bar, which changes the width of the menu item
-> the menu bar becomes smaller, so it's now displayed on one line
-> the zoom factor changes
-> back to step 2, infinite loop

This would happen even when updating the factor only after resizing.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1231
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *AntonyD »

2. TC shows the new zoom factor in the title bar, which changes the width of the menu item
-> the menu bar becomes too wide, so it's now displayed on two lines
[img]https://i.ibb.co/LS6Q844/1.png[/img]
I must be crazy - but in which Title bar i must see the zoom factor? As I see it - there is only full filename does exist in this area.
Thus I do not understand - which menu bar should fit inside itself 2 lines. Where? How (with which conditions)?
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *ghisler(Author) »

I meant menu bar, not title bar, sorry.
Author of Total Commander
https://www.ghisler.com
siealex
Senior Member
Senior Member
Posts: 278
Joined: 2009-03-22, 16:36 UTC

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *siealex »

2. TC shows the new zoom factor in the title bar, which changes the width of the menu item
-> the menu bar becomes too wide, so it's now displayed on two lines
-> the zoom factor changes
Is it possible to create a fixed size field for the zoom factor?
We are not so S.M.A.R.T. as we imagine...
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *ghisler(Author) »

Maybe when using owner drawn menus. The 32-bit version currently uses normal text menu items where Windows determines the width, and the 64-bit version draws them somewhere in the component library.
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: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *Slavic »

I think that possible infinite loop is more an imaginable problem rather than an inevitable side effect. Because currently we test the beta versions of next TC release, I think we can try to test this option and check whether it is really buggy or not.

Can you add the test code which shows the current zoom level of resized-to-window picture immediately at start, but do not enable it by default? Instead, it can be activated by a specific test switch in wincmd.ini. Then any tester, me for example, will be able to enable this switch and test this option in practice. If the possible bad side effect will be unavoidably happen, this code and switch may be removed before release. Otherwise it can be kept as passed the test.
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: TC10.50b2: Lister in "Fit to window" mode should show real % of zoom

Post by *ghisler(Author) »

Sorry, I prefer not to add it. Adding this calls for big troubles for many beta versions to come, and there are already far too many other bugs to fix.
Author of Total Commander
https://www.ghisler.com
Post Reply