Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show access key underline (mnemonics) of menu items on focus #11679

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

droidmonkey
Copy link
Member

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

image

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

  • ✅ Bug fix (non-breaking change that fixes an issue)

* Fixes #7325

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
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.66%. Comparing base (f39a2c5) to head (b12b67b).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11679      +/-   ##
===========================================
- Coverage    63.68%   63.66%   -0.02%     
===========================================
  Files          366      366              
  Lines        38522    38522              
===========================================
- Hits         24531    24524       -7     
- Misses       13991    13998       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access keys not visible in the Light / Dark themes
1 participant