Chopped icons on dark mode if bar is too tall

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Chopped icons on dark mode if bar is too tall

Post by *petermad »

I tried on another Windows 7 computer with 2560x1440 resolution - no problems - long bars wraps into 2 or more columns and all icons are fine.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Chopped icons on dark mode if bar is too tall

Post by *gdpr deleted 6 »

Exactly how many items do you have in the problematic sub-menu bar?
What happens if you add or remove an item from the sub-menu bar?

I wonder whether the issue might perhaps be a buggy edge case in some flawed calculation of the pop-up menu height (or of the number of required menu columns, if you will), triggered by just the right combination of the screen height, icon size and number of items in the sub-menu bar... hmm...
User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Chopped icons on dark mode if bar is too tall

Post by *petermad »

There has been similar problems with the Main Menu:
https://www.ghisler.ch/board/viewtopic.php?f=15&t=54706&hilit=menu

The number of items in a bar can also bee important for some bugs:
https://www.ghisler.ch/board/viewtopic.php?p=361517#p361517


2sidefx88
Could you perhaps try whith this bar: http://madsenworld.dk/tcmd/win10amd64_2_eng.zip
Last edited by petermad on 2020-04-23, 23:00 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: Chopped icons on dark mode if bar is too tall

Post by *sidefx88 »

2elgonzo: my problematic bar has 54 icons. If I remove just one icon the problem is solved! If I add just one icon the problem is solved as well!

2petermad: I've tried your bar (win10amd63_2_eng.bar) and it works fine (it shows icons in two columns).
I Love Total Commander!
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Chopped icons on dark mode if bar is too tall

Post by *gdpr deleted 6 »

I can confirm exactly the same issue on Windows 7, both with the 32-bit and 64-bit versions of 9.51 (other versions not tested), when using the same parameters as OP:

Screen resolution: 1920x1080
Number of items in sub-menu bar: 54
Checkbox "Small icons": Enabled
Icon size: 16

Assuming a height of 20 pixels for a popup menu entry, then 54*20 = 1080.

This makes me think TC does not account for any possible padding and/or border at the top and bottom of the popup when determining how many entries fit in a column to keep it within the screen area. Thus, TC ends up with a single-column sub-menu popup that is larger than the screen and which exposes the issue as linked to by Peter in his last comment above.

EDIT: To make it clear, i can reproduce the whole experience on Windows 7, including the chopped-off icons and invisible scroll icons at the top and bottom of the popup (with each only becoming fully visible when selected/hovered over) when in dark mode.
User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Chopped icons on dark mode if bar is too tall

Post by *petermad »

Hmm, here I see the problem when Buttoncount=51 inside the bar file, small icons = 16, Windows 7 1920x1080 pixel resolution
I am using Arial 10 as my system font for menus and dialogs.

If I change to using Segoe UI 9, then it happens at Buttoncount=56. Of those 56, the first icon leads back to the mother bar, and is not shown in menu mode, so that is 55 items shown (no separators).

In both cases there are 2 items more in the menu than can fit on the screen, with the given font. That fits with those 2 lines that, when the issue is seen, is used for the Up and Down scroll arrows.
Last edited by petermad on 2020-04-24, 11:01 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: Chopped icons on dark mode if bar is too tall

Post by *gdpr deleted 6 »

petermad wrote: 2020-04-24, 08:25 UTC Hmm, here I see the problem when Buttoncount=51 inside the bar file, small icons = 16, Windows 7 1920x1080 pixel resolution
I am using Arial 10 as my system font for menus and dialogs.
Oh my. That rabbit hole goes deep. I just checked myself. And I did not even need to change the button count in my test bar with 54 entries.


UPDATE: Please disregard the stuff i have written below. With regard to the different popup menu heights when using Arial 10 vs. Segoe UI 9, while it remains true that the entries in both cases are 20px high, i forgot to look closely at the height of the little scroll-buttons. And, as you might already suspect, the scroll-buttons have different heights (unlike the menu entries themselves), explaining the different number of shown entries in the popup menu (the popup avoids showing partially visible/cut-off entries).


Changing the system setting for the menu font to Arial 10 while keeping the system setting for the the menu size at 18 (Arial 10 fits just fine within a pixel height of 18px using standard Win7 DPI settings) is enough to produce the result you observed. The individual menu entries still are just 20px in height (as before), yet the font change completely throws the calculation out of whack, with the popup now being somewhat smaller than the screen, displaying 51 of the 54 entries (insted of 52 i observed when using Segoe UI 9) plus the two scroll buttons at the top and bottom of the popup.

See this image: https://imgur.com/a/wVOfV3k , where i put screenshots of the same sub-menu popup using Segoe UI 9 and using Arial 10 as system menu font side by side. Note the menu entry height being exactly the same for both fonts: 20px. Yet, the height of the popup is different. (The height of the screenshots is the full height of the screen: 1080px)

Argh... Troubleshooting and fixing the thing will probably be a great joy... :(

P.S.: Easter egg: If you zoom into the image i linked to, you will find remnants of a sunken/raised border between some menu entries ;-)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Chopped icons on dark mode if bar is too tall

Post by *ghisler(Author) »

I have analyzed the problem and found the following: It happens when the number of lines multiplied by the line height reaches the height of the screen. This should fit, but Windows adds scroll buttons at the top and bottom anyway. TC never expects hat and uses the extra space at the top and bottom to calculate the black border width - which is of course too big with these extra areas.

As some have already pointed out, the temporary fix is to either add or remove one entry.
Author of Total Commander
https://www.ghisler.com
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Re: Chopped icons on dark mode if bar is too tall

Post by *sidefx88 »

Thanks to everyone
I Love Total Commander!
Post Reply