Wrong icon shown when opening a button bar as menu

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

TC 10.51rc2 x32 @ Win10x64
  1. Create a new button bar B that opens as menu (drop down)
  2. In B, add a new button that has a command and an icon (e.g., simply select the internal command cm_SrcAllFiles)
  3. Left of B, add a new button that has just a tooltip (but *no* command and *no* icon)
    (such buttons can be used to structure large button bar menues)
Once you open B, the first button is simply missing. --> Maybe a bug?
I find this strange since the button *does* exist and has a tooltip. Imho it should be displayed without icon.

Now:
  1. Add any icon of your choice to the button (but leave the command empty)
Once you open B, the first button shows the tooltip as the first entry (which is fine) but it always receives the icon of the second button. --> Certainly a bug!
Actually, it should show its own icon. Instead: If you change the icon of the second button, the first first button always shows the same.

Finally:
  1. Add a command to the button (e.g., cm_RereadSource)
Now, the button shows up with the correct icon. --> fine again.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong icon shown when opening a button bar as menu

Post by *ghisler(Author) »

Once you open B, the first button is simply missing. --> Maybe a bug?
This is intentional. Buttons without a command are shown as separators. A separator at the start of the menu will not be shown.
Once you open B, the first button shows the tooltip as the first entry (which is fine) but it always receives the icon of the second button.
It should be hidden too, because the button still does nothing.

When you show it as a button bar, buttons without a command always show up as a separator.
Author of Total Commander
https://www.ghisler.com
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

ghisler(Author) wrote: 2022-08-24, 08:24 UTC
Once you open B, the first button is simply missing. --> Maybe a bug?
This is intentional. Buttons without a command are shown as separators. A separator at the start of the menu will not be shown.
Once you open B, the first button shows the tooltip as the first entry (which is fine) but it always receives the icon of the second button.
It should be hidden too, because the button still does nothing.

When you show it as a button bar, buttons without a command always show up as a regular separator.
Hm. hm. hm. Sure, the separators, I know ...
On the one hand I can understand this idea.

On the other hand:
I would recommend to interpret a button that has no command AND no icon AND no tooltip as separator.
But once an icon or a tooltip is defined, the button should definitely show up. (I mean: Why hide information that is explicitly defined?)

With buttons that have just a tooltip (but no command and just an optional icon), one can easily structure button bar menues with "sections" (you might call it a "named separator"):

https://ibb.co/rvbb7Tq

This image is of course just an example, but i guess the idea is clear.

If a button bar is *not* shown as (drop down) menu but as a regular horizontal bar, these "named separators" can still be shown as vertical line.

@ghisler / @community What do you think about this idea?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong icon shown when opening a button bar as menu

Post by *ghisler(Author) »

But once an icon or a tooltip is defined, the button should definitely show up.
But WHY would anyone do this? Also the bar has shown such buttons as separators forever.
Author of Total Commander
https://www.ghisler.com
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

ghisler(Author) wrote: 2022-08-24, 09:01 UTC
But once an icon or a tooltip is defined, the button should definitely show up.
But WHY would anyone do this? Also the bar has shown such buttons as separators forever.
Exactly for the reason explained in the previous post:
funkymonk wrote: 2022-08-24, 08:44 UTC
With buttons that have just a tooltip (but no command and just an optional icon), one can easily structure button bar menues with "sections" (you might call it a "named separator"):

https://ibb.co/rvbb7Tq

This image is of course just an example, but i guess the idea is clear.

If a button bar is *not* shown as (drop down) menu but as a regular horizontal bar, these "named separators" can still be shown as vertical line.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong icon shown when opening a button bar as menu

Post by *ghisler(Author) »

I will consider it for a future version. Unfortunately the bar and dropdown menu share the same loading functions, so I can't change it easily.
Author of Total Commander
https://www.ghisler.com
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

Ok, thank you for considering.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong icon shown when opening a button bar as menu

Post by *ghisler(Author) »

This should be fixed in RC3 by removing the entry without command, please test! I haven't added your suggestion yet, though.

24.08.22 Fixed: Button bar, show button as menu: Always show buttons with empty command field as separators, even if they have an icon or hint text, hide when at the start of the bar (32/64)
Author of Total Commander
https://www.ghisler.com
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

ghisler(Author) wrote: 2022-08-26, 09:29 UTC This should be fixed in RC3 by removing the entry without command, please test! I haven't added your suggestion yet, though.

24.08.22 Fixed: Button bar, show button as menu: Always show buttons with empty command field as separators, even if they have an icon or hint text, hide when at the start of the bar (32/64)
TC 10.51rc3: Seems to be fixed (according to the author's explanation).
ghisler(Author) wrote: 2022-08-26, 09:29 UTC I haven't added your suggestion yet, though.
I am still hoping for my suggestion to be picked up... :D
User avatar
BenderBey
Junior Member
Junior Member
Posts: 4
Joined: 2022-04-17, 15:20 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *BenderBey »

Please return it as it was. Very convenient headers.
https://ibb.co/0ZpZ0jL
User avatar
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

BenderBey wrote: 2022-08-26, 18:24 UTC Please return it as it was. Very convenient headers.
https://ibb.co/0ZpZ0jL
That's exactly what I wanted to point out with my OP: The possibility to create headers or subsections in button bar menus...

I fear I raised a topic that led to a worsening instead of an improvement... :(
User avatar
white
Power Member
Power Member
Posts: 4619
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Wrong icon shown when opening a button bar as menu

Post by *white »

You can use rundll32.exe as command and icon though.
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Wrong icon shown when opening a button bar as menu

Post by *petermad »

Please return it as it was. Very convenient headers.
I fear I raised a topic that led to a worsening instead of an improvement
I agree.

In my oppinion a button without a command and an Icon, but with a Tooltip, should be shown as a separator in bar mode and in menu mode it should be shown as a menu item with a blank icon and the tooltip,
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
funkymonk
Senior Member
Senior Member
Posts: 416
Joined: 2013-12-04, 09:56 UTC

Re: Wrong icon shown when opening a button bar as menu

Post by *funkymonk »

white wrote: 2022-08-26, 20:16 UTC You can use rundll32.exe as command and icon though.
True.

Maybe that's useful for others as well: For various purposes (such as the one discussed here) I have created a user command that simply does nothing:

Code: Select all

[em_NOP]
button=
cmd=
User avatar
white
Power Member
Power Member
Posts: 4619
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Wrong icon shown when opening a button bar as menu

Post by *white »

2funkymonk
And as icon file you could enter a space.

Only, this no longer works:
petermad wrote: 2022-08-26, 22:52 UTC In my oppinion a button without a command and an Icon, but with a Tooltip, should be shown as a separator in bar mode and in menu mode it should be shown as a menu item with a blank icon and the tooltip,
Post Reply