[9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

[9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *Flint »

There is an issue with the auto-hiding the new "Dark<->Normal" menu item, when a user has a custom main menu. The disappearance of this command may make the menu look weird.

Here are a few scenarios I could think of:

1. The command is at the top of a popup, followed by a separator:

Code: Select all

    POPUP "Some settings"
        MENUITEM "Dark<->Normal", 2950
        MENUITEM SEPARATOR
        ...
Result: the popup menu will have a dangling separator at the top.

2. The command is at the bottom of a popup, after a separator:

Code: Select all

        ...
        MENUITEM SEPARATOR
        MENUITEM "Dark<->Normal", 2950
    END_POPUP
Result: the popup menu will have a dangling separator at the bottom.

3. The command is between two separators:

Code: Select all

        …
        MENUITEM SEPARATOR
        MENUITEM "Dark<->Normal", 2950
        MENUITEM SEPARATOR
        ...
Result: the popup menu will have a double separator.

4. A popup menu is comprised exclusively of the dark mode commands:

Code: Select all

    POPUP "Control the Dark Side"
        MENUITEM "Switch Your Side", 2950
        MENUITEM "Become Sith", 2951
        MENUITEM "Become Jedi", 2952
    END_POPUP
Result: the whole popup menu turns into a non-popup fake entry which does not do anything.

I understand that a normal user won't enable and disable dark mode on a whim, he/she can choose once, whether to have this option or not, and adjust the menu accordingly. Unfortunately, this approach does not work for distributable custom menus included in third-party localization packages.

I'm not sure what's best to do here. The first 3 issues could be fixed within TC by identifying those layouts and removing the excess separator. As for the 4th scenario I have absolutely no clue as to what is best. Maybe show it as the disabled menu entry, while keeping the popup triangle marker at the right? (So it would still look like a popup, but it won't be able to expand.)
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *petermad »

I think the best approach would be to show "Dark<->Normal" as disabled the same way as these commands are shown disabled when not connected to an FTP site:
cm_FtpDisconnect=552;Disconnect from FTP
cm_FtpAbort=554;Abort current FTP command
cm_FtpResumeDownload=555;Resume aborted download
See: https://madsenworld.dk/tcmd/disabledmenuentries.png

And off course the two other Dark mode commands should also be shown disabled when ForceDarkModeOptions=0 or under an OS where Dark mode is not supported in TC:
cm_EnableDarkmode=2951;Turn dark mode on
cm_DisableDarkmode=2952;Turn dark mode off


And while we are at it - this command should be shown disabled in 64bit TC and in 32bit Windows:
cm_SwitchX64Redirection=2925;64-bit Windows: Redirect 32-bit system32 dir off/on

And these should also be shown as disabled on Windows versions newer than XP:
cm_EditPermissionInfo=2200;Permissions dialog (NTFS)
cm_EditAuditInfo=2201;File auditing (NTFS)
cm_EditOwnerInfo=2202;Take ownership (NTFS)
See: https://madsenworld.dk/tcmd/ntfsmenu.png
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
ghisler(Author)
Site Admin
Site Admin
Posts: 48070
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *ghisler(Author) »

I think the best approach would be to show "Dark<->Normal" as disabled
Then people would complain why it doesn't work.

No, I think I can look for separators above+below, and if 2 are together or at the edge of the menu, I can remove one. But it's quite a bit of work...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *MVV »

Well, I don't think that such actions should be done because of possible complains. In fact, you have already get complains just because TC hides these items.
Possible solutions:
* disable them (this is a standard way of deactivating menu items that don't work in current context overall the world)
* show a message if user triggers them when dark mode is disabled (so user will fully understand why these options do nothing).
Such logic is simple and clear, you don't have to check for any inconsistencies caused by removing menu items.
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: [9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *Flint »

I personally vote for disabling the menu items, instead of hiding them. I totaly agree that it's a well-known and standard mechanics for indicating that the command is unavailable. And since TC allows editing the menu files, it's not a problem to delete the command manually if someone doesn't want to see it at all.

After all, the commands are not hidden from the TC menu when, for example, RestrictInterface options are in effect. (They aren't even disabled, for that matter…)
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Re: [9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *Flint »

In 9.50rc2 the respective menu commands are now disabled instead of being hidden. So the problem no longer exists, thank you!
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [9.50rc1] Hiding 'Dark-Normal' menu item in custom menus

Post by *petermad »

26.01.20 Fixed: Show all dark mode menu items as disabled instead of hiding them when ForceDarkModeOptions=0 (which is the default on Windows versions older than XP) (32/64)
Confirmed changed in TC 9.5rc2 :-)
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
Post Reply