Skip to content

Add option to hide access-key markers (&) in menu names#135

Merged
Jack251970 merged 3 commits into
Jack251970:masterfrom
KamilDev:strip-menu-mnemonics
Apr 22, 2026
Merged

Add option to hide access-key markers (&) in menu names#135
Jack251970 merged 3 commits into
Jack251970:masterfrom
KamilDev:strip-menu-mnemonics

Conversation

@KamilDev
Copy link
Copy Markdown

@KamilDev KamilDev commented Apr 22, 2026

Summary

  • Adds an opt-in StripMenuMnemonics setting (off by default) that strips Win32 access-key & markers from displayed menu item names and collapses && to a literal &, so the list matches what Explorer renders.
  • Applies the transform at every assignment of Text from registry/XML sources across shell, shellex, shellnew, sendto, winx, openwith, IE, UWP, rule, and guid-blocked items, plus EnhanceMenuList and DetailedEditList.
  • Adds a toggle under the existing "other settings" group in AppSettingView, with en-US and zh-CN strings.
  • Editing an item's text still operates on the raw ItemText rather than the stripped display text, so mnemonics are preserved on save.

The toggle does not need to trigger an explicit refresh: the setting is only reachable via the Settings page, and MainWindow.NavigateTo clears and rebuilds any list on navigation, which re-runs the strip on every Text assignment. The GuidInfo.ItemTextDic cache holds raw pre-strip text, so stripping is reapplied on each rebuild regardless of cache state. SearchService.Initialize is called from LoadItems, so search snapshots also refresh.

Test plan

  • Build in Release and launch.
  • With the setting off, confirm items that contain & (e.g. &Open, Cu&t) display unchanged.
  • Toggle the setting on, navigate to a list, and confirm single & is removed and && collapses to one &.
  • Rename an item while the setting is on; confirm the edit dialog shows the raw text with & and saving preserves it.
  • Toggle the setting off again and confirm original text returns without an app restart.
  • Switch between en-US and zh-CN and verify the new label renders.

Copy link
Copy Markdown
Owner

@Jack251970 Jack251970 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please resolve the merge conflicts?

# Conflicts:
#	ContextMenuManager/Methods/AppConfig.cs
#	ContextMenuManager/Methods/AppString.cs
#	ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini
#	ContextMenuManager/Views/AppSettingView.xaml
#	ContextMenuManager/Views/AppSettingView.xaml.cs
#	languages/en-US.ini
#	languages/zh-CN.ini
Puts "Hide access-key markers" next to "Hide disabled items" and
"Hide system store items", so the three Hide* rows cluster by shared
intent. Dim inferred icons moves to the end.
@KamilDev
Copy link
Copy Markdown
Author

Conflicts resolved on the latest push, ready for another look.

One small note: while merging upstream I also moved the DimInferredIcons row (from #136) to sit after the new StripMenuMnemonics row, so the three Hide* toggles cluster together — happy to revert that cosmetic change if you'd prefer.

@Jack251970 Jack251970 merged commit 02c59fa into Jack251970:master Apr 22, 2026
1 check passed
@KamilDev KamilDev deleted the strip-menu-mnemonics branch April 22, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants