activitybarActions.ts 21.4 KB
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import 'vs/css!./media/activityaction';
P
Pine Wu 已提交
7
import * as nls from 'vs/nls';
8
import * as DOM from 'vs/base/browser/dom';
P
Pine Wu 已提交
9
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
B
Benjamin Pasero 已提交
10
import { EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch';
11
import { Action, IAction, Separator, SubmenuAction } from 'vs/base/common/actions';
P
Pine Wu 已提交
12
import { KeyCode } from 'vs/base/common/keyCodes';
13 14
import { DisposableStore } from 'vs/base/common/lifecycle';
import { IMenuService, MenuId, IMenu, registerAction2, Action2, IAction2Options } from 'vs/platform/actions/common/actions';
15
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
P
Pine Wu 已提交
16 17
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { activeContrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
M
Martin Aeschlimann 已提交
18
import { ICssStyleCollector, IColorTheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
19
import { ActivityAction, ActivityActionViewItem, ICompositeBar, ICompositeBarColors, ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/compositeBarActions';
20
import { CATEGORIES } from 'vs/workbench/common/actions';
21
import { IActivity } from 'vs/workbench/common/activity';
22
import { ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_ACTIVE_BORDER, ACTIVITY_BAR_ACTIVE_FOCUS_BORDER, ACTIVITY_BAR_ACTIVE_BACKGROUND, ACTIVITY_BAR_BACKGROUND } from 'vs/workbench/common/theme';
23
import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService';
24
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
P
Pine Wu 已提交
25
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
26
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
27
import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
S
SteVen Batten 已提交
28
import { isMacintosh, isWeb } from 'vs/base/common/platform';
29
import { getCurrentAuthenticationSessionInfo, IAuthenticationService } from 'vs/workbench/services/authentication/browser/authenticationService';
30 31
import { AuthenticationSession } from 'vs/editor/common/modes';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
32
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
S
SteVen Batten 已提交
33
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
S
Sandeep Somavarapu 已提交
34
import { IProductService } from 'vs/platform/product/common/productService';
35
import { AnchorAlignment, AnchorAxisAlignment } from 'vs/base/browser/ui/contextview/contextview';
36
import { getTitleBarStyle } from 'vs/platform/windows/common/windows';
37
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
E
Erich Gamma 已提交
38

39
export class ViewContainerActivityAction extends ActivityAction {
40

41
	private static readonly preventDoubleClickDelay = 300;
42

43
	private lastRun = 0;
44 45

	constructor(
46
		activity: IActivity,
47 48 49 50
		@IViewletService private readonly viewletService: IViewletService,
		@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
		@ITelemetryService private readonly telemetryService: ITelemetryService,
		@IConfigurationService private readonly configurationService: IConfigurationService
51
	) {
52
		super(activity);
S
Sandeep Somavarapu 已提交
53 54
	}

55
	updateActivity(activity: IActivity): void {
S
Sandeep Somavarapu 已提交
56
		this.activity = activity;
57 58
	}

59
	async run(event: unknown): Promise<void> {
60
		if (event instanceof MouseEvent && event.button === 2) {
61
			return; // do not run on right click
62 63 64 65
		}

		// prevent accident trigger on a doubleclick (to help nervous people)
		const now = Date.now();
C
ChaseKnowlden 已提交
66
		if (now > this.lastRun /* https://github.com/microsoft/vscode/issues/25830 */ && now - this.lastRun < ViewContainerActivityAction.preventDoubleClickDelay) {
67
			return;
68 69 70
		}
		this.lastRun = now;

71
		const sideBarVisible = this.layoutService.isVisible(Parts.SIDEBAR_PART);
72
		const activeViewlet = this.viewletService.getActiveViewlet();
S
SteVen Batten 已提交
73
		const focusBehavior = this.configurationService.getValue<string>('workbench.activityBar.iconClickBehavior');
74

B
Benjamin Pasero 已提交
75
		if (sideBarVisible && activeViewlet?.getId() === this.activity.id) {
S
SteVen Batten 已提交
76 77 78 79 80 81 82 83 84 85 86 87 88
			switch (focusBehavior) {
				case 'focus':
					this.logAction('refocus');
					this.viewletService.openViewlet(this.activity.id, true);
					break;
				case 'toggle':
				default:
					// Hide sidebar if selected viewlet already visible
					this.logAction('hide');
					this.layoutService.setSideBarHidden(true);
					break;
			}

89
			return;
90 91
		}

92
		this.logAction('show');
93
		await this.viewletService.openViewlet(this.activity.id, true);
94

95
		return this.activate();
96
	}
97 98

	private logAction(action: string) {
99 100 101 102 103
		type ActivityBarActionClassification = {
			viewletId: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
			action: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
		};
		this.telemetryService.publicLog2<{ viewletId: String, action: String }, ActivityBarActionClassification>('activityBarAction', { viewletId: this.activity.id, action });
104
	}
105 106
}

107
class MenuActivityActionViewItem extends ActivityActionViewItem {
108

109
	constructor(
110
		private readonly menuId: MenuId,
111 112 113
		action: ActivityAction,
		colors: (theme: IColorTheme) => ICompositeBarColors,
		@IThemeService themeService: IThemeService,
114 115 116 117 118
		@IMenuService protected readonly menuService: IMenuService,
		@IContextMenuService protected readonly contextMenuService: IContextMenuService,
		@IContextKeyService protected readonly contextKeyService: IContextKeyService,
		@IConfigurationService protected readonly configurationService: IConfigurationService,
		@IWorkbenchEnvironmentService protected readonly environmentService: IWorkbenchEnvironmentService
119 120 121 122 123 124 125 126 127 128 129 130
	) {
		super(action, { draggable: false, colors, icon: true }, themeService);
	}

	render(container: HTMLElement): void {
		super.render(container);

		// Context menus are triggered on mouse down so that an item can be picked
		// and executed with releasing the mouse over it

		this._register(DOM.addDisposableListener(this.container, DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => {
			DOM.EventHelper.stop(e, true);
131
			this.showContextMenu(e);
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
		}));

		this._register(DOM.addDisposableListener(this.container, DOM.EventType.KEY_UP, (e: KeyboardEvent) => {
			let event = new StandardKeyboardEvent(e);
			if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
				DOM.EventHelper.stop(e, true);
				this.showContextMenu();
			}
		}));

		this._register(DOM.addDisposableListener(this.container, TouchEventType.Tap, (e: GestureEvent) => {
			DOM.EventHelper.stop(e, true);
			this.showContextMenu();
		}));
	}

148 149 150 151 152 153
	protected async showContextMenu(e?: MouseEvent): Promise<void> {
		const disposables = new DisposableStore();

		const menu = disposables.add(this.menuService.createMenu(this.menuId, this.contextKeyService));
		const actions = await this.resolveActions(menu, disposables);

R
Robo 已提交
154
		const isUsingCustomMenu = isWeb || (getTitleBarStyle(this.configurationService) !== 'native' && !isMacintosh); // see #40262
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
		const position = this.configurationService.getValue('workbench.sideBar.location');

		this.contextMenuService.showContextMenu({
			getAnchor: () => isUsingCustomMenu ? this.container : e || this.container,
			anchorAlignment: isUsingCustomMenu ? (position === 'left' ? AnchorAlignment.RIGHT : AnchorAlignment.LEFT) : undefined,
			anchorAxisAlignment: isUsingCustomMenu ? AnchorAxisAlignment.HORIZONTAL : AnchorAxisAlignment.VERTICAL,
			getActions: () => actions,
			onHide: () => disposables.dispose()
		});
	}

	protected async resolveActions(menu: IMenu, disposables: DisposableStore): Promise<IAction[]> {
		const actions: IAction[] = [];

		disposables.add(createAndFillInActionBarActions(menu, undefined, { primary: [], secondary: actions }));

		return actions;
	}
}

export class HomeActivityActionViewItem extends MenuActivityActionViewItem {

	static readonly HOME_BAR_VISIBILITY_PREFERENCE = 'workbench.activity.showHomeIndicator';

	constructor(
		private readonly goHomeHref: string,
		action: ActivityAction,
		colors: (theme: IColorTheme) => ICompositeBarColors,
		@IThemeService themeService: IThemeService,
		@IMenuService menuService: IMenuService,
		@IContextMenuService contextMenuService: IContextMenuService,
		@IContextKeyService contextKeyService: IContextKeyService,
		@IConfigurationService configurationService: IConfigurationService,
		@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
		@IStorageService private readonly storageService: IStorageService
	) {
		super(MenuId.MenubarHomeMenu, action, colors, themeService, menuService, contextMenuService, contextKeyService, configurationService, environmentService);
	}

	protected async resolveActions(homeMenu: IMenu, disposables: DisposableStore): Promise<IAction[]> {
		const actions = [];

		// Go Home
		actions.push(disposables.add(new Action('goHome', nls.localize('goHome', "Go Home"), undefined, true, async () => window.location.href = this.goHomeHref)));
		actions.push(disposables.add(new Separator()));

		// Contributed
		const contributedActions = await super.resolveActions(homeMenu, disposables);
		actions.push(...contributedActions);

		// Hide
		if (contributedActions.length > 0) {
			actions.push(disposables.add(new Separator()));
		}
209
		actions.push(disposables.add(new Action('hide', nls.localize('hide', "Hide Home Button"), undefined, true, async () => {
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
			this.storageService.store(HomeActivityActionViewItem.HOME_BAR_VISIBILITY_PREFERENCE, false, StorageScope.GLOBAL, StorageTarget.USER);
		})));

		return actions;
	}
}

export class AccountsActivityActionViewItem extends MenuActivityActionViewItem {

	static readonly ACCOUNTS_VISIBILITY_PREFERENCE_KEY = 'workbench.activity.showAccounts';

	constructor(
		action: ActivityAction,
		colors: (theme: IColorTheme) => ICompositeBarColors,
		@IThemeService themeService: IThemeService,
		@IContextMenuService contextMenuService: IContextMenuService,
		@IMenuService menuService: IMenuService,
		@IContextKeyService contextKeyService: IContextKeyService,
		@IAuthenticationService private readonly authenticationService: IAuthenticationService,
		@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
		@IStorageService private readonly storageService: IStorageService,
		@IProductService private readonly productService: IProductService,
		@IConfigurationService configurationService: IConfigurationService,
	) {
		super(MenuId.AccountsContext, action, colors, themeService, menuService, contextMenuService, contextKeyService, configurationService, environmentService);
	}

	protected async resolveActions(accountsMenu: IMenu, disposables: DisposableStore): Promise<IAction[]> {
		await super.resolveActions(accountsMenu, disposables);

240 241
		const otherCommands = accountsMenu.getActions();
		const providers = this.authenticationService.getProviderIds();
242
		const allSessions = providers.map(async providerId => {
R
Rachel Macfarlane 已提交
243
			try {
244
				const sessions = await this.authenticationService.getSessions(providerId);
R
Rachel Macfarlane 已提交
245 246 247 248 249 250 251 252 253 254

				const groupedSessions: { [label: string]: AuthenticationSession[] } = {};
				sessions.forEach(session => {
					if (groupedSessions[session.account.label]) {
						groupedSessions[session.account.label].push(session);
					} else {
						groupedSessions[session.account.label] = [session];
					}
				});

255
				return { providerId, sessions: groupedSessions };
R
Rachel Macfarlane 已提交
256
			} catch {
257
				return { providerId };
R
Rachel Macfarlane 已提交
258
			}
259 260 261
		});

		const result = await Promise.all(allSessions);
262
		let menus: IAction[] = [];
263
		const authenticationSession = this.environmentService.options?.credentialsProvider ? await getCurrentAuthenticationSessionInfo(this.environmentService, this.productService) : undefined;
264
		result.forEach(sessionInfo => {
265
			const providerDisplayName = this.authenticationService.getLabel(sessionInfo.providerId);
266

R
Rachel Macfarlane 已提交
267 268
			if (sessionInfo.sessions) {
				Object.keys(sessionInfo.sessions).forEach(accountName => {
269
					const manageExtensionsAction = disposables.add(new Action(`configureSessions${accountName}`, nls.localize('manageTrustedExtensions', "Manage Trusted Extensions"), '', true, () => {
R
Rachel Macfarlane 已提交
270
						return this.authenticationService.manageTrustedExtensionsForAccount(sessionInfo.providerId, accountName);
271 272 273
					}));

					const signOutAction = disposables.add(new Action('signOut', nls.localize('signOut', "Sign Out"), '', true, () => {
R
Rachel Macfarlane 已提交
274
						return this.authenticationService.signOutOfAccount(sessionInfo.providerId, accountName);
275 276 277
					}));

					const providerSubMenuActions = [manageExtensionsAction];
R
Rachel Macfarlane 已提交
278

279
					const hasEmbedderAccountSession = sessionInfo.sessions[accountName].some(session => session.id === (authenticationSession?.id));
280
					if (!hasEmbedderAccountSession || authenticationSession?.canSignOut) {
281
						providerSubMenuActions.push(signOutAction);
282
					}
283

284 285
					const providerSubMenu = disposables.add(new SubmenuAction('activitybar.submenu', `${accountName} (${providerDisplayName})`, providerSubMenuActions));
					menus.push(providerSubMenu);
R
Rachel Macfarlane 已提交
286 287
				});
			} else {
288 289
				const providerUnavailableAction = disposables.add(new Action('providerUnavailable', nls.localize('authProviderUnavailable', '{0} is currently unavailable', providerDisplayName)));
				menus.push(providerUnavailableAction);
R
Rachel Macfarlane 已提交
290
			}
291 292
		});

R
Rachel Macfarlane 已提交
293
		if (menus.length && otherCommands.length) {
294
			menus.push(disposables.add(new Separator()));
295 296
		}

297
		otherCommands.forEach((group, i) => {
298 299
			const actions = group[1];
			menus = menus.concat(actions);
300
			if (i !== otherCommands.length - 1) {
301
				menus.push(disposables.add(new Separator()));
302
			}
303 304
		});

305
		if (menus.length) {
306
			menus.push(disposables.add(new Separator()));
307 308
		}

309
		menus.push(disposables.add(new Action('hide', nls.localize('hideAccounts', "Hide Accounts"), undefined, true, async () => {
310 311
			this.storageService.store(AccountsActivityActionViewItem.ACCOUNTS_VISIBILITY_PREFERENCE_KEY, false, StorageScope.GLOBAL, StorageTarget.USER);
		})));
312

313 314
		return menus;
	}
315 316
}

317
export class GlobalActivityActionViewItem extends MenuActivityActionViewItem {
B
Benjamin Pasero 已提交
318 319

	constructor(
320
		action: ActivityAction,
M
Martin Aeschlimann 已提交
321
		colors: (theme: IColorTheme) => ICompositeBarColors,
B
Benjamin Pasero 已提交
322
		@IThemeService themeService: IThemeService,
323 324 325 326 327
		@IMenuService menuService: IMenuService,
		@IContextMenuService contextMenuService: IContextMenuService,
		@IContextKeyService contextKeyService: IContextKeyService,
		@IConfigurationService configurationService: IConfigurationService,
		@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService
B
Benjamin Pasero 已提交
328
	) {
329
		super(MenuId.GlobalActivity, action, colors, themeService, menuService, contextMenuService, contextKeyService, configurationService, environmentService);
B
Benjamin Pasero 已提交
330 331 332
	}
}

333
export class PlaceHolderViewContainerActivityAction extends ViewContainerActivityAction { }
B
Benjamin Pasero 已提交
334

335
export class PlaceHolderToggleCompositePinnedAction extends ToggleCompositePinnedAction {
B
Benjamin Pasero 已提交
336 337

	constructor(id: string, compositeBar: ICompositeBar) {
R
Rob Lourens 已提交
338
		super({ id, name: id, cssClass: undefined }, compositeBar);
B
Benjamin Pasero 已提交
339 340 341 342 343 344 345
	}

	setActivity(activity: IActivity): void {
		this.label = activity.name;
	}
}

346
class SwitchSideBarViewAction extends Action2 {
P
Pine Wu 已提交
347 348

	constructor(
349 350
		desc: Readonly<IAction2Options>,
		private readonly offset: number
P
Pine Wu 已提交
351
	) {
352
		super(desc);
P
Pine Wu 已提交
353 354
	}

355 356 357
	async run(accessor: ServicesAccessor): Promise<void> {
		const activityBarService = accessor.get(IActivityBarService);
		const viewletService = accessor.get(IViewletService);
P
Pine Wu 已提交
358

359 360 361
		const visibleViewletIds = activityBarService.getVisibleViewContainerIds();

		const activeViewlet = viewletService.getActiveViewlet();
P
Pine Wu 已提交
362
		if (!activeViewlet) {
363
			return;
P
Pine Wu 已提交
364
		}
M
Matt Bierner 已提交
365
		let targetViewletId: string | undefined;
S
SteVen Batten 已提交
366 367
		for (let i = 0; i < visibleViewletIds.length; i++) {
			if (visibleViewletIds[i] === activeViewlet.getId()) {
368
				targetViewletId = visibleViewletIds[(i + visibleViewletIds.length + this.offset) % visibleViewletIds.length];
P
Pine Wu 已提交
369 370 371
				break;
			}
		}
372

373
		await viewletService.openViewlet(targetViewletId, true);
P
Pine Wu 已提交
374 375 376
	}
}

377 378 379 380 381 382 383 384 385
registerAction2(
	class PreviousSideBarViewAction extends SwitchSideBarViewAction {
		constructor() {
			super({
				id: 'workbench.action.previousSideBarView',
				title: { value: nls.localize('previousSideBarView', "Previous Side Bar View"), original: 'Previous Side Bar View' },
				category: CATEGORIES.View,
				f1: true
			}, -1);
386 387
		}
	}
388 389 390 391 392 393 394 395 396 397 398 399
);

registerAction2(
	class NextSideBarViewAction extends SwitchSideBarViewAction {
		constructor() {
			super({
				id: 'workbench.action.nextSideBarView',
				title: { value: nls.localize('nextSideBarView', "Next Side Bar View"), original: 'Next Side Bar View' },
				category: CATEGORIES.View,
				f1: true
			}, 1);
		}
B
Benjamin Pasero 已提交
400
	}
401
);
P
Pine Wu 已提交
402

M
Martin Aeschlimann 已提交
403
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
404 405 406 407 408 409 410 411
	const activityBarBackgroundColor = theme.getColor(ACTIVITY_BAR_BACKGROUND);
	if (activityBarBackgroundColor) {
		collector.addRule(`
			.monaco-workbench .activitybar > .content > .home-bar > .home-bar-icon-badge {
				background-color: ${activityBarBackgroundColor};
			}
		`);
	}
412

413 414
	const activityBarForegroundColor = theme.getColor(ACTIVITY_BAR_FOREGROUND);
	if (activityBarForegroundColor) {
415
		collector.addRule(`
M
Miguel Solorio 已提交
416 417 418
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active .action-label:not(.codicon),
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:focus .action-label:not(.codicon),
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:hover .action-label:not(.codicon) {
419
				background-color: ${activityBarForegroundColor} !important;
420
			}
B
Benjamin Pasero 已提交
421
			.monaco-workbench .activitybar > .content .home-bar > .monaco-action-bar .action-item .action-label.codicon,
M
Miguel Solorio 已提交
422 423 424
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active .action-label.codicon,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:focus .action-label.codicon,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:hover .action-label.codicon {
425
				color: ${activityBarForegroundColor} !important;
M
Miguel Solorio 已提交
426
			}
427 428 429
		`);
	}

430 431
	const activityBarActiveBorderColor = theme.getColor(ACTIVITY_BAR_ACTIVE_BORDER);
	if (activityBarActiveBorderColor) {
432
		collector.addRule(`
433
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked .active-item-indicator:before {
434
				border-left-color: ${activityBarActiveBorderColor};
435 436 437 438
			}
		`);
	}

439 440
	const activityBarActiveFocusBorderColor = theme.getColor(ACTIVITY_BAR_ACTIVE_FOCUS_BORDER);
	if (activityBarActiveFocusBorderColor) {
441 442 443 444 445 446 447
		collector.addRule(`
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:focus::before {
				visibility: hidden;
			}

			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:focus .active-item-indicator:before {
				visibility: visible;
448
				border-left-color: ${activityBarActiveFocusBorderColor};
449 450 451 452
			}
		`);
	}

453 454
	const activityBarActiveBackgroundColor = theme.getColor(ACTIVITY_BAR_ACTIVE_BACKGROUND);
	if (activityBarActiveBackgroundColor) {
455
		collector.addRule(`
456
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked .active-item-indicator {
457
				z-index: 0;
458
				background-color: ${activityBarActiveBackgroundColor};
459 460 461 462
			}
		`);
	}

463
	// Styling with Outline color (e.g. high contrast theme)
464
	const outline = theme.getColor(activeContrastBorder);
465 466
	if (outline) {
		collector.addRule(`
S
SteVen Batten 已提交
467
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:before {
468 469
				content: "";
				position: absolute;
470 471 472
				top: 9px;
				left: 9px;
				height: 32px;
473
				width: 32px;
M
Miguel Solorio 已提交
474
				z-index: 1;
475 476
			}

S
SteVen Batten 已提交
477 478 479 480
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active:hover:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:hover:before {
481 482 483
				outline: 1px solid;
			}

S
SteVen Batten 已提交
484
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:hover:before {
485 486 487
				outline: 1px dashed;
			}

S
SteVen Batten 已提交
488
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:focus:before {
489 490 491
				border-left-color: ${outline};
			}

S
SteVen Batten 已提交
492 493 494 495 496
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.active:hover:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item.checked:hover:before,
			.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:hover:before {
497 498 499 500 501 502 503
				outline-color: ${outline};
			}
		`);
	}

	// Styling without outline color
	else {
504
		const focusBorderColor = theme.getColor(focusBorder);
505 506
		if (focusBorderColor) {
			collector.addRule(`
S
SteVen Batten 已提交
507
					.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .action-item:focus:before {
508 509 510
						border-left-color: ${focusBorderColor};
					}
				`);
511
		}
512
	}
513
});