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

QMenubar option to show/hide itself #10341

Merged

Conversation

Kingston1
Copy link
Contributor

@Kingston1 Kingston1 commented Feb 28, 2024

This pull request brings a minor new feature to the QMenubar View section. It implements the ability to show and hide menubar itself. This feature is basically 1:1 copy of the functionality that is quite common in modern menubars, but the best examples are probably Mozilla Firefox and Thunderbird.

When menubar is hidden, it can be toggled hidden/visible with Alt key press.

Also note that this feature does not apply to macOS.

Known Issues:
This is just a minor issue and I don't consider it a merge blocker. Qt eats the QMenubar automated focus that comes default when pressing Alt. It should select the first QMenubar element automatically, but when the menubar is changed from hidden to visible this does not happen. It works fine when menubar is already visible - which is the default so nothing broken there at least. I did all kinds of setFocus experiments around the eventFilter, but none worked this far. This issue is cross-platform and seems like a bug in Qt internal event propagation.

Screenshots

The new menu action:
image

Here menu is hidden:
image

Testing strategy

Manual tests with the UI itself. Regularly comparing functionality between this and Mozilla Firefox and Thunderbird.
Could not find places to unit test this as QtWidgets are not designed for that at all.

Tested on Ubuntu 22.04.4 and Windows 11.

Type of change

  • ✅ New feature (change that adds functionality)

@Kingston1 Kingston1 force-pushed the feature/show-hide-menubar branch 4 times, most recently from 7b78327 to 9b43745 Compare March 2, 2024 12:36
@droidmonkey droidmonkey added this to the v2.7.8 milestone Mar 31, 2024
@droidmonkey
Copy link
Member

@Kingston1 what do you think of adding this:

if (menubar->isVisible()) {
    menubar->setActiveAction(mainWindow->m_ui->menuFile->menuAction());
}

This will cause the Database menu to pop out when Alt is pressed. It's definitely more than focusing the menu, but it does work nicely. I also couldn't get the focus to work no matter what.

@Kingston1
Copy link
Contributor Author

Kingston1 commented Mar 31, 2024

@Kingston1 what do you think of adding this:

if (menubar->isVisible()) {
    menubar->setActiveAction(mainWindow->m_ui->menuFile->menuAction());
}

This will cause the Database menu to pop out when Alt is pressed. It's definitely more than focusing the menu, but it does work nicely. I also couldn't get the focus to work no matter what.

I did exactly this as part of the experiments. But it's not like Firefox or Thunderbird which just shows the plain menu. Possibly it's even a bit distracting as it's not necessarily what the user is looking for. Since there are 6 top level menu items, it's statistically unlikely the correct choice.

I am not completely against it, as it does indeed bring the keyboard focus, but it also was more than I was used to as UI information.

@droidmonkey
Copy link
Member

droidmonkey commented Mar 31, 2024

Without that option, you don't gain focus at all and are forced to use the mouse. Statistics doesn't really apply since we aren't guessing what the user wants to focus on, but it's the same behavior as regular alt (database menu has focus) just that it appears. I actually like it a little more, one less key press. Navigating to the other 5 menus is a simple arrow key away.

I also added some protection from false activations if the user is actually pressing alt+tab or similar key combo.

@droidmonkey droidmonkey merged commit a542ded into keepassxreboot:develop Apr 28, 2024
11 checks passed
pull bot pushed a commit to shashinma/keepassxc that referenced this pull request Apr 28, 2024
--------

Co-authored-by: Mikko Saarinki <mikko.saarinki@michaelkingston.fi>
Co-authored-by: Jonathan White <support@dmapps.us>
pull bot pushed a commit to sysfce2/keepassxc that referenced this pull request Apr 28, 2024
--------

Co-authored-by: Mikko Saarinki <mikko.saarinki@michaelkingston.fi>
Co-authored-by: Jonathan White <support@dmapps.us>
pull bot pushed a commit to tigerwill90/keepassxc that referenced this pull request Apr 28, 2024
--------

Co-authored-by: Mikko Saarinki <mikko.saarinki@michaelkingston.fi>
Co-authored-by: Jonathan White <support@dmapps.us>
droidmonkey added a commit that referenced this pull request Apr 28, 2024
--------

Co-authored-by: Mikko Saarinki <mikko.saarinki@michaelkingston.fi>
Co-authored-by: Jonathan White <support@dmapps.us>
droidmonkey added a commit that referenced this pull request Apr 29, 2024
--------

Co-authored-by: Mikko Saarinki <mikko.saarinki@michaelkingston.fi>
Co-authored-by: Jonathan White <support@dmapps.us>
libf-de pushed a commit to libf-de/keepassxc-secretservice-dbus that referenced this pull request May 6, 2024
Release 2.7.8

Changes
- Add hotkey for showing search help [keepassxreboot#10591]
- Add hotkey for group switching (Ctrl+Shift+PgUp/PgDown) [keepassxreboot#10625]
- Add per-database auto-save delay setting [keepassxreboot#9100]
- Add setting to hide menubar [keepassxreboot#10341]
- Improve Bitwarden 1PUX import and support organization collections [keepassxreboot#10499]
- Show advanced settings checkbox only for settings that have them [keepassxreboot#6513]
- Remove obsolete setting for requiring repeated password entry [keepassxreboot#9722]
- Passkeys: Allow registering Passkeys to existing entries [keepassxreboot#10408]
- Passkeys: Show warning about data being unencrypted before Passkey export [keepassxreboot#10411]
- Passkeys: Support NFC and USB transports [keepassxreboot#10402]
- Passkeys: Pass extension JSON data to browser [keepassxreboot#10615]
- SSH Agent: Do not use entries from recycle bin [keepassxreboot#10518]
- Linux: Change hotkey sequence used for {CLEARFIELD} Auto-Type [keepassxreboot#10008]
- Windows: Improve DACL memory access protection [keepassxreboot#10618]

Fixes
- Fix crash when deleting history items [keepassxreboot#10451]
- Fix crash on screen lock or computer sleep [keepassxreboot#10458]
- Fix search field not being focused after unlock [keepassxreboot#10459]
- Fix loss of window focus when Auto-Type needs to unlock a database [keepassxreboot#10555]
- Fix inconsistent TOTP visibility on unlock [keepassxreboot#10009]
- Fix CSV import skipping over single-name groups [keepassxreboot#10575]
- Fix key file folder being remembered even if disabled in settings [keepassxreboot#10636]
- Fix issues with entry editing and database locking [keepassxreboot#10667]
- Fix key file text when provided on command line [keepassxreboot#10642]
- Fix issues with hardware key auto detection [keepassxreboot#10663]
- Do not override monospace font size [keepassxreboot#10282]
- Perform group sort only when group view is in focus [keepassxreboot#10202]
- Do not show decimals for attachment sizes in Bytes [keepassxreboot#10595]
- Prevent merging of global custom data when merging databases [keepassxreboot#10452]
- Fix minor translation issues [keepassxreboot#10635]
- Passkeys: Fix StrongBox incompatibility [keepassxreboot#10420]
- Passkeys: Set RP ID to effective domain if unset instead of returning an error [keepassxreboot#10384]
- Passkeys: Various UI fixes and improvements [keepassxreboot#10427, keepassxreboot#10608, keepassxreboot#10609]
- AppImage: Fix URL opening [keepassxreboot#10624]
- Flatpak: Fix application autostart [keepassxreboot#10563]
- Linux/macOS: Fix button sizes on modal alert popups [keepassxreboot#10500]
- Linux: Fix clipboard clear on Wayland [keepassxreboot#10500]
- Windows: Preserve file-hidden attribute [keepassxreboot#10343]

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE6A9nU7OzJX8m9B8ILPQdKqhDj5kFAmY4A30ACgkQLPQdKqhD
# j5npgBAApBCGfhdugBE3X9iCkGQ69LKKWizgp44AzmezxU2ee7KEoZgSmZpOCPyO
# bg9EIgwac+3yCh4i4hJrTvnwIemrUKNsNLE18Kn/Uw3HJBCtsb40CeIFcZktOegu
# RQ5G7jhBtnAopnTKQhdwcwJ0Yq6ZSTSiSuo+miDAN22DjnWVd7BLMOioSBPgxFUT
# td+2MAPeydLoMdFRmkuBaDSStLWThdCz6DrWcBYQSK2b6Mu+3mzmtE24zNM1jCKu
# Tl0t6fRkOhqWSRyWBSMzIH3uMuV95yQNudjDMnuOVWVE9Ai+A1RPFHtf8Zj1ydh9
# n9JGPDyloWRcYQdDBgbn6lFHWnwSaYVCRpRPPmjpmXVwt5/AdtB8wN+6uGbcYTzw
# u9l0YYWx84W0kNPkJ0ZejF33qioQ7FaZruJv2ej++NtO0FJP48UVyrQ4EMG6V+17
# AcQ0aoSWWTb5AYhJXLjImDG7DNY1mbgW6deJLKVS7pkoRke1uSLGqYTUAJCFaXnq
# d9uZt4HRUUMeq6x8dvFNvIcZhsfRUaO/iXjp81nl8hlWIeTYNTj22eww3yapFs+S
# cdmdCmfGZAx5FWCXaszXwD3gLF8Bg6S63l9TvbjEHGR2riYKOO1IbFz8JXXjWpdN
# l4SIcWJfdO2mNz0MWfzNtmMYNu9LBfU2Hod5JHJQYiQh3dh4EG4=
# =MrBi
# -----END PGP SIGNATURE-----
# gpg: directory '/home/runner/.gnupg' created
# gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
# gpg: Signature made Sun May  5 22:09:01 2024 UTC
# gpg:                using RSA key E80F6753B3B3257F26F41F082CF41D2AA8438F99
# gpg: Can't check signature: No public key
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.

None yet

2 participants