diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index f14318b949a80206c5fda936685cdc6c756f423e..86c445e811c253f54c1bfab6363b03e6086b3786 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -384,17 +384,13 @@ export class Workbench implements IPartService { } private createGlobalActions(): void { + const isDeveloping = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment; - // Developer related actions - const developerCategory = localize('developer', "Developer"); + // Actions registered here to adjust for developing vs built workbench const workbenchActionsRegistry = Registry.as(Extensions.WorkbenchActions); - const isDeveloping = !this.environmentService.isBuilt || this.environmentService.isExtensionDevelopment; workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyCode.KEY_R } : void 0), 'Reload Window'); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', developerCategory); - - // Action registered here to prevent a keybinding conflict with reload window - const fileCategory = localize('file', "File"); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent', fileCategory); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', localize('developer', "Developer")); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent', localize('file', "File")); } private resolveEditorsToOpen(): TPromise { diff --git a/src/vs/workbench/parts/debug/browser/debugActionItems.ts b/src/vs/workbench/parts/debug/browser/debugActionItems.ts index b81283f1ac149afb1369520512617a0373e014e2..8f83bebe2daa92f03e82dc05549f1b3dd99c08f3 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionItems.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionItems.ts @@ -10,15 +10,16 @@ import { IAction, IActionRunner } from 'vs/base/common/actions'; import { KeyCode } from 'vs/base/common/keyCodes'; import * as dom from 'vs/base/browser/dom'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; -import { SelectBox, ISelectBoxStyles } from 'vs/base/browser/ui/selectBox/selectBox'; +import { SelectBox } from 'vs/base/browser/ui/selectBox/selectBox'; import { SelectActionItem, IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { EventEmitter } from 'vs/base/common/eventEmitter'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IDebugService } from 'vs/workbench/parts/debug/common/debug'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler'; +import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; +import { selectBorder } from "vs/platform/theme/common/colorRegistry"; const $ = dom.$; @@ -115,14 +116,10 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem { event.stopPropagation(); } })); - this.toDispose.push(attachSelectBoxStyler({ - style: (colors: ISelectBoxStyles) => { - if (colors.selectBorder) { - this.container.style.borderColor = colors.selectBorder.toString(); - selectBoxContainer.style.borderLeftColor = colors.selectBorder.toString(); - } - } - }, this.themeService)); + this.toDispose.push(attachStylerCallback(this.themeService, { selectBorder }, colors => { + this.container.style.borderColor = colors.selectBorder; + selectBoxContainer.style.borderLeftColor = colors.selectBorder; + })); this.updateOptions(); }