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

Custom Menubar Implementation #51422

Merged
merged 102 commits into from
Jun 18, 2018
Merged

Custom Menubar Implementation #51422

merged 102 commits into from
Jun 18, 2018

Conversation

sbatten
Copy link
Member

@sbatten sbatten commented Jun 8, 2018

Adding custom menubar on windows with themable menus including context menus.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

Some more code review feedback

@@ -87,6 +87,10 @@
color: inherit;
}

.monaco-menu .monaco-action-bar.vertical .action-label.checked:after {
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten is this used currently anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bpasero this adds the checkmark to items that have been checked in the menu, like auto save

@@ -487,9 +493,6 @@ export class CodeApplication {
}
}

// Install Menu
appInstantiationService.createInstance(CodeMenu);
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten is the functionality from vs/code/electron-main/menus.ts moved over to menubar.ts? then I think it would be safe to remove menu.ts?

However I see that some things are not working yet, like the Accessibility help window, so maybe that is still work in progress?

@@ -1580,7 +1580,6 @@ export class EditorLayoutCenteredAction extends Action {
}

public run(): TPromise<any> {

Copy link
Member

Choose a reason for hiding this comment

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

@sbatten unrelated change?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bpasero reverted

@@ -24,8 +24,128 @@
flex: 0 1 auto;
overflow: hidden;
white-space: nowrap;
line-height: 22px;
Copy link
Member

Choose a reason for hiding this comment

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

@sbatten why? this impacts even macOS that does not use a custom menu

Copy link
Member Author

Choose a reason for hiding this comment

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

@bpasero the value is inherited from the parent and the parent is being updated to handle zoom

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

@sbatten I did another code review and pushed some polish to the branch. I think there is one thing to revisit before merging: the changes in ActionBar have some issues:

  • we are no longer using builder.text but builder.innerHTML for the label. this increases the risk of someone injecting a HTML script into our DOM because we set it blindly as HTML. we need to continue to not trust IAction.label as before imho
  • Actionbar#push() seems to do the mnemonic handling now. first of all, we should probably only do that if the action that is pushed has isMenu: true in the options. Second, there seems to be a map of mnemonics to IAction but the lifecycle is not clear to me. Actions can come and go in the action bar but this map seems to just grow and never cleanup when an action is removed?

@equinusocio
Copy link

@bpasero Hi, there is already a documentation for this api?

@sbatten sbatten deleted the titlebarplus branch September 18, 2018 18:02
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants