Show access key underline (mnemonics) of menu items on focus #11679
+24
−6
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.
Qt 5.x defaults to always show mnemonic underlines in menus. Qt 6.x fixes this, but we can't port the fix since it relies on private theme namespaces. Anyway, to get around this, simply check if the widget is a menubar and focused. If so, we draw the underlines. Only applies when the user actually presses ALT so this is desired behavior.
NOTE: Underlines in menus will disappear once you focus on the menu, still working on this... I don't know if there will be a fully acceptable solution without tapping into MainWindow directly and setting up some state bools.
Screenshots
Testing strategy
Tested on Windows and Linux. This fix doesn't apply to macOS since it doesn't show the mnemonic underlines.
Type of change