-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Add an option to hide/show menu bar. #1090
Conversation
Adding a menu item to the view menu that allows you hide/show the menu bar. If the menu bar is hidden you toggle it on and off with the "Alt" key.
Hi @rstat1, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@rstat1, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
Wow that's exactly what I need. |
@be5invis Not bad for someone who's never written Typescript before eh? |
@rstat1 yeah. |
Thanks! But can you not rather use the setAutoHideMenuBar() [1] method instead and avoid having to implement the key listener for Alt? Also, please check if this solution is cross platform, it does not seem to work on Mac and thus should not show up there. |
@bpasero As far as mac compatibility, it was something I was going to do, and for w/e reason forgot, my mistake. |
@rstat1 yes feel free to add it to the d.ts files if missing! |
@bpasero Oh well ok, that simplifies things quite a bit. I'll fix everything up and have a new request ready shortly. |
@bpasero Ok. Done. Menu item disappears on mac, and everything uses the official Electron APIs now instead of my custom stuff. |
@rstat1 nice. I wonder if this should not rather be a setting in the user settings configuration? We typically try to put settings into there instead of overloading the menu. I would think of a window.setting that controls this behavior. Otherwise, how do you persist this setting? |
@bpasero There's already items within the "View" menu for toggling other things like the sidebar and full screen mode, so I think it'd make sense to have the menu bar toggle there as well.. With the way settings are currently done in VS Code I don't think that'd be the best place for it. As far as persisting the toggle across sessions I'd agree that it's something needed. |
@rstat1 right, those things are being persisted though (except for fullscreen, but that is for other reasons). We have 2 stories for persisting state: Either in the settings.json which is owned by the user or in local storage which is more for UI state. I think this should probably go into the local storage category as long as there is a menu item to toggle it. |
@bpasero Local storage it is then! |
…alStorage whether or not auto hide is active.
@bpasero Ok, so I added the ability to save whether the menu bar is auto hidden or not. Not sure if I've done everything in the right places. Also there appears to be merge conflicts that I (being a git/github noob) have no idea how to resolve. |
@rstat1 from your branch you can update the pull request easily by merging in the changes from master.
|
@bpasero aha! It worked! Thanks :) |
This landed in similar fashion, please see c34d2e7 |
For the most part, this also works on Linux Mint 17.1 albeit a bit glitchy. |
Adding a menu item to the view menu that allows you hide/show the menu bar. If the menu bar is hidden you toggle it on and off with the "Alt" key.
Fixes #945