Skip to content

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

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

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)

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.92%. Comparing base (37ddbb3) to head (858f815).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #11679   +/-   ##
========================================
  Coverage    63.92%   63.92%           
========================================
  Files          369      369           
  Lines        38920    38920           
========================================
  Hits         24878    24878           
  Misses       14042    14042           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* 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
@droidmonkey droidmonkey force-pushed the fix/underline-shortcuts branch from b12b67b to 858f815 Compare March 30, 2025 12:23
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