Fix: disable mnemonic accelerator keys in menu's path labels #392
+47
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solvespace version: 3.0~46528bfc
OS: Gentoo GNU/Linux
Already signed Solvespace's Contributor License Agreement.
Bug
File > Open Recent
andNew Group > Link Recent
replace/remove strings in file paths and activate mnemonic accelerator keys.This means that on GNU/Linux the path
/tmp/_foo_&_bar_.slvs
is showed as/tmp/foo_bar.slvs
.settings.json
Proposed solution
Add
mnemonics
argument toPlatform::Menu::AddItem
to treat as raw text label's mnemonic accelerator keys when it isfalse
(src/platform/gui.h
).New pure virtual functionPlatform::Menu::AddItemRaw
which treats as raw text label's mnemonic accelerator keys (src/platform/gui.h
).AddItemRaw
doesn't replace/remove label's text (i.e.guigtk.cpp '&' -> '_'
), nor it activates mnemonic accelerator keys.Caveats
Solution tested only on Gentoo GNU/Linux.
The code in
src/platform/guiwin.cpp
andsrc/platform/guimac.mm
isn't tested and may require amendments.Does
NegateMnemonics
escape mnemonic accelerator keys correctly (src/platform/guiwin.cpp
)?Not sure ifAddItemRaw
inguiwin.cpp
shall allocate a buffer before assigning it tomii.dwTypeData
. Also, doesSetMenuItemInfoW
operate as expected updating the menu item's label?Can someone review the code, please?