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

API: submenus extension point #102784

Merged
merged 45 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
762bb93
submenus api extension point
joaomoreno Jul 17, 2020
16ce08b
fix nls
joaomoreno Jul 17, 2020
6584270
add runtime submenu support validation
joaomoreno Jul 17, 2020
18e9e7f
Merge remote-tracking branch 'origin/master' into joao/submenus
joaomoreno Jul 21, 2020
af15adf
move SubmenuAction to common
joaomoreno Jul 21, 2020
375bdea
move Separator down to actions
joaomoreno Jul 21, 2020
86ec536
fix submenus across workbench
joaomoreno Jul 21, 2020
d3cd7bc
Merge branch 'master' into joao/submenus
joaomoreno Jul 22, 2020
eed2e95
fix native submenus, delete ContextSubMenu
joaomoreno Jul 22, 2020
26aa8ee
fix compile error
joaomoreno Jul 22, 2020
0528d12
submenus always support submenus
joaomoreno Jul 22, 2020
5b2e422
proper SubmenuAction.id
joaomoreno Jul 22, 2020
c2e4add
prevent submenu cycles
joaomoreno Jul 22, 2020
095c690
fix submenus in scm/sourceControl
joaomoreno Jul 22, 2020
6f77c06
fix submenus in extension/context menu
joaomoreno Jul 22, 2020
f49561e
fix submenus in view/item/context menu
joaomoreno Jul 22, 2020
e7279b1
isolate action view items, delete duplicate IActionViewItem interface
joaomoreno Jul 22, 2020
89f2de6
move IActionViewItemProvider to actions
joaomoreno Jul 22, 2020
7ceb3af
isolate DropdownMenuActionViewItem
joaomoreno Jul 22, 2020
b0c51ca
create IDropdownMenuActionViewItemOptions
joaomoreno Jul 22, 2020
6fbe03a
cleanup actionbar ctor
joaomoreno Jul 22, 2020
a387a6c
extract IContextMenuProvider
joaomoreno Jul 22, 2020
ef60cb8
missing reference
joaomoreno Jul 22, 2020
bfa31af
polish ToolBar
joaomoreno Jul 22, 2020
de26a53
:lipstick:
joaomoreno Jul 22, 2020
7cae7a0
submenu support on toolbars :partying_face:
joaomoreno Jul 22, 2020
8488049
wip: submenu icons
joaomoreno Jul 23, 2020
f0252d2
strict null checks
joaomoreno Jul 23, 2020
cfd8266
delete ContextAwareMenuEntryActionViewItem
joaomoreno Jul 23, 2020
6d2a2f0
delete unused code
joaomoreno Jul 23, 2020
e6f3f16
SubmenuEntryActionViewItem
joaomoreno Jul 23, 2020
83662c9
ViewPane knows about menu items
joaomoreno Jul 23, 2020
7465af9
missing unused code
joaomoreno Jul 23, 2020
ab3e5f9
unused code
joaomoreno Jul 23, 2020
d683e21
reduce usage of MenuEntryActionViewItem
joaomoreno Jul 23, 2020
642adf0
fix submenus in editor title control
joaomoreno Jul 23, 2020
ce389f3
fix submenus in peek
joaomoreno Jul 23, 2020
10a0727
redundant code
joaomoreno Jul 23, 2020
fca1e0f
spread SubmenuEntryActionViewItem all over
joaomoreno Jul 23, 2020
28d97ae
update menu extension point schema for submenus
joaomoreno Jul 23, 2020
c3cef6f
make menusExtensionPoint.ts easier to edit
joaomoreno Jul 23, 2020
42d6c1f
fix submenu json schema, add proposed disclaimers
joaomoreno Jul 23, 2020
187e9dd
Merge branch 'master' into joao/submenus
joaomoreno Jul 23, 2020
1f5ece2
fix activitybarPart import error
joaomoreno Jul 23, 2020
a7fdaf4
fix import errors
joaomoreno Jul 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/vs/base/browser/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { IAction, IActionRunner } from 'vs/base/common/actions';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { IAction, IActionRunner, IActionViewItem } from 'vs/base/common/actions';
import { ResolvedKeybinding } from 'vs/base/common/keyCodes';
import { SubmenuAction } from 'vs/base/browser/ui/menu/menu';
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';

export interface IContextMenuEvent {
Expand All @@ -16,15 +14,9 @@ export interface IContextMenuEvent {
readonly metaKey?: boolean;
}

export class ContextSubMenu extends SubmenuAction {
constructor(label: string, public entries: Array<ContextSubMenu | IAction>) {
super(label, entries, 'contextsubmenu');
}
}

export interface IContextMenuDelegate {
getAnchor(): HTMLElement | { x: number; y: number; width?: number; height?: number; };
getActions(): ReadonlyArray<IAction | ContextSubMenu>;
getActions(): IAction[];
getCheckedActionsRepresentation?(action: IAction): 'radio' | 'checkbox';
getActionViewItem?(action: IAction): IActionViewItem | undefined;
getActionsContext?(event?: IContextMenuEvent): any;
Expand All @@ -36,3 +28,7 @@ export interface IContextMenuDelegate {
anchorAlignment?: AnchorAlignment;
anchorAsContainer?: boolean;
}

export interface IContextMenuProvider {
showContextMenu(delegate: IContextMenuDelegate): void;
}
Loading