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

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

droidmonkey
Copy link
Member

Testing strategy

Tested manually

Type of change

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

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 31.25000% with 11 lines in your changes missing coverage. Please review.

Project coverage is 63.72%. Comparing base (d57d167) to head (fb5dd1e).

Files with missing lines Patch % Lines
src/gui/MainWindow.cpp 31.25% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11355      +/-   ##
===========================================
+ Coverage    63.71%   63.72%   +0.01%     
===========================================
  Files          362      362              
  Lines        38000    38014      +14     
===========================================
+ Hits         24210    24222      +12     
- Misses       13790    13792       +2     

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

Copy link
Member

@varjolintu varjolintu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work properly. If you follow these steps, you cannot get the menubar back until you've changed the option via Application Settings:

  1. Disable the Show Menubar option from menu. Confirm that it works properly.
  2. Enable the Show Menubar option from menu.
  3. Menu bar goes hidden again. You cannot get it back even when pressing Alt. Is the timer still running? Or the options is not actually checked?
  4. Go to Application Settings and change the value of Show Menubar. Everything works again.

@droidmonkey
Copy link
Member Author

Oops, forgot to guard the timer with the config setting

@droidmonkey
Copy link
Member Author

@varjolintu fixed

* Fixes #10768
* Also fix menubar toggling not working if Qt version is less than 5.15
@droidmonkey
Copy link
Member Author

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

@xboxones1
Copy link
Contributor

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
Copy link
Member

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

@droidmonkey
Copy link
Member Author

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

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.

Menubar is not hidden automatically when there is no focus
3 participants