-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
core: added appearance and editor layout sub-menus #10220
core: added appearance and editor layout sub-menus #10220
Conversation
fbe5375
to
449a07a
Compare
These changes are a good start. I wonder if you're interested in adding additional commands to the new 'Appearance' menu to bring it closer to VSCode? Here's what they've got and what you've added so far: Some of the things on the VSCode menu don't make any sense for us: moving the side bar right or the panel left don't really mean anything for us. I think we can add a command for 'Show Menu Bar' now that we support the |
449a07a
to
4840466
Compare
packages/core/src/electron-browser/menu/electron-menu-contribution.ts
Outdated
Show resolved
Hide resolved
ed15ed6
to
67d8cde
Compare
9ec6935
to
e6a17a0
Compare
@msujew I was wondering if you are able to help me out with localizing this PR and I am not sure how to acquire the keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Archie27376 Thanks for asking. I usually just look up the english text in the vscode codebase (which I simply opened using github.dev
or pressing .
while in the vscode github repo) and build the translation key based on that: vscode/<filename>/<id>
, where the id
is the ID used in the vscode localize
call, and the filename is the file (without extension) that contains that call.
I'm currently building a tool to simplify that process, but for now that's the simplest way that I found. Anyway, I helped you with that (since it's kind of my fault, that the workflow for translating Theia - at least for now - is so complicated), see the suggestions.
packages/core/src/electron-browser/menu/electron-menu-contribution.ts
Outdated
Show resolved
Hide resolved
e6a17a0
to
03eaa69
Compare
Would someone be able to review this PR? |
@Archie27376, there are a couple of ways to get people's attention. Using an @ makes it more likely that it'll show up in someone's notifications, and requesting a review from someone using using the reviewers widget in the upper-right area will make sure that it shows up in the reviewer's 'PR's awaiting review' queue. |
@Archie27376, please rebase this, and you may be able to make use of some of the new localization utilities that have been added by #10319 . |
1f4c3fc
to
2850034
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some nitpicks regarding the localizations, everything else looks good.
2850034
to
4e00abd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One funny behavior that I see in Electron with Native menus is that the Editor Layout submenu may not show up if you start the application with no editors. It will show up if you open an editor and then change menu modes (now easily available from the appearance menu :-)). Since that behavior might be strange to users who don't understand the perils of Electron's native menus, it might be best to make the split editor commands always enabled and execution just a no-op if there's nothing to split.
4e00abd
to
d3c445f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, and the behavior of the menu in Electron with native menus is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me as well. @colin-grant-work merge at your discretion :)
@Archie27376, sorry I've left this long enough that you'll need to rebase. Ping me when you're done, and I'll merge. |
0bd86b2
to
bcc1013
Compare
@colin-grant-work ping :) |
isEnabled: () => !!this.editorManager.currentEditor, | ||
execute: async () => { | ||
const { currentEditor } = this.editorManager; | ||
if (currentEditor) { | ||
const selection = currentEditor.editor.selection; | ||
const newEditor = await this.editorManager.openToSide(currentEditor.editor.uri, { selection, widgetOptions: { mode: splitMode } }); | ||
const oldEditorState = currentEditor.editor.storeViewState(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you've resolved the conflict here in favor of your code, but the changes made in the conflicting commit were significant - without them, the editor tab context menu will be broken. I think your change was made to ensure that this item would be visible in electron even if no editor was present at startup. To achieve that, please keep the old code, but remove the isVisible
and isEnabled
checks.
bcc1013
to
3fc564a
Compare
@colin-grant-work ping |
The commit adds the registration of an `appearance` and `editor layout` sub-menu to the `view` main menu. Names have also been localized. The `appearance` menu is used to group menu items related to the appearance of the workbench or layout. The `editor layout` menu groups items related to splitting the workbench. Commands present in vscode's appearance and editor layout menu that exist in the framework were moved to the new sub-menus.
3fc564a
to
a413dc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The View menu is much improved, and the other menus continue to show what they should. 👍
What it does
The commit adds the registration of an
appearance
andeditor layout
submenu to theview
main-menu.The
appearance
menu is used to group menu items related to the appearance of the workbench or layout.The
editor layout
menu groups items related to splitting the workbench.Commands present in vscode's appearance and editor layout menu that exist in the framework were moved to these new submenus.
How to test
Follow steps to open the Electron app:
yarn electron build
yarn
yarn electron start
Click on the
View
menu from the top bar and then theAppearance
andEditor Layout
sub-menus within. The list of options will be present, click on each one to test their features, but some require prerequisites to be useful.Review checklist
Reminder for reviewers