Hide the menubar when menus lose focus (if toggled off)
- 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)
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.
Oops, forgot to guard the timer with the config setting
@varjolintu fixed
Cleaned up the code logic a little bit and reduced the timeout to 250ms. 1 second resulted in weird delays.
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.
Dunno if it's worth saving the last menu opened?
Pressing ALT in the situation shown in the video should hide the menu bar, will have to look into that.
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.