keepassxc icon indicating copy to clipboard operation
keepassxc copied to clipboard

Hide the menubar when menus lose focus (if toggled off)

Open droidmonkey opened this issue 1 year ago • 7 comments

  • Fixes #10768
  • Also fix menubar toggling not working if Qt version is less than 5.15

Testing strategy

Tested manually

Type of change

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

droidmonkey avatar Oct 12 '24 20:10 droidmonkey

Codecov Report

Attention: Patch coverage is 39.28571% with 17 lines in your changes missing coverage. Please review.

Project coverage is 63.79%. Comparing base (34fe413) to head (00cea92). Report is 20 commits behind head on develop.

Files with missing lines Patch % Lines
src/gui/MainWindow.cpp 39.29% 17 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11355      +/-   ##
===========================================
- Coverage    63.80%   63.79%   -0.02%     
===========================================
  Files          362      362              
  Lines        38056    38072      +16     
===========================================
+ Hits         24281    24285       +4     
- Misses       13775    13787      +12     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 12 '24 20:10 codecov[bot]

Oops, forgot to guard the timer with the config setting

droidmonkey avatar Oct 12 '24 20:10 droidmonkey

@varjolintu fixed

droidmonkey avatar Oct 12 '24 20:10 droidmonkey

Cleaned up the code logic a little bit and reduced the timeout to 250ms. 1 second resulted in weird delays.

droidmonkey avatar Oct 13 '24 14:10 droidmonkey

It works well, but I don't know how critical it is, hiding with Alt button sometimes works incorrectly. Instead of hiding the menu, the first menu item is opened. keepassxc

xboxones1 avatar Oct 16 '24 08:10 xboxones1

Dunno if it's worth saving the last menu opened?

varjolintu avatar Oct 16 '24 12:10 varjolintu

Pressing ALT in the situation shown in the video should hide the menu bar, will have to look into that.

droidmonkey avatar Oct 16 '24 12:10 droidmonkey

It works well, but I don't know how critical it is, hiding with Alt button sometimes works incorrectly. Instead of hiding the menu, the first menu item is opened.

Fixed it with a cooldown timer that ignores the ALT key for 250ms. This is because on Windows pressing ALT de-selects the active menu which causes the timer to hide the toolbar and then releasing ALT causes the toolbar to re-appear. So ignoring that key release ensures the toolbar stays hidden.

droidmonkey avatar Oct 26 '24 14:10 droidmonkey