keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.39k stars 1.48k forks source link

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

Closed droidmonkey closed 3 weeks ago

droidmonkey commented 1 month ago

Testing strategy

Tested manually

Type of change

codecov[bot] commented 1 month ago

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 10 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 ```diff @@ 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.


🚨 Try these New Features:

droidmonkey commented 1 month ago

Oops, forgot to guard the timer with the config setting

droidmonkey commented 1 month ago

@varjolintu fixed

droidmonkey commented 1 month ago

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

xboxones1 commented 1 month ago

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

varjolintu commented 1 month ago

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

droidmonkey commented 1 month ago

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

droidmonkey commented 3 weeks ago

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.