Skip to content

Commit

Permalink
Add new terminal with profile button
Browse files Browse the repository at this point in the history
Part of #120241
  • Loading branch information
Tyriar committed Apr 14, 2021
1 parent ec579a2 commit 94f637a
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/vs/workbench/contrib/terminal/browser/terminalTabbedView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { ITerminalService, TerminalConnectionState } from 'vs/workbench/contrib/terminal/browser/terminal';
import { TerminalFindWidget } from 'vs/workbench/contrib/terminal/browser/terminalFindWidget';
import { TerminalTabsWidget } from 'vs/workbench/contrib/terminal/browser/terminalTabsWidget';
import { IThemeService, IColorTheme, ThemeIcon } from 'vs/platform/theme/common/themeService';
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
import * as nls from 'vs/nls';
import { isLinux, isMacintosh } from 'vs/base/common/platform';
import * as dom from 'vs/base/browser/dom';
Expand All @@ -25,12 +25,11 @@ import { IMenu, IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { KEYBINDING_CONTEXT_TERMINAL_FIND_VISIBLE, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminal';
import { newTerminalIcon } from 'vs/workbench/contrib/terminal/browser/terminalIcons';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ContextMenuTabsGroup } from 'vs/workbench/contrib/terminal/browser/terminalActions';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { Codicon } from 'vs/base/common/codicons';
import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';

const $ = dom.$;

Expand Down Expand Up @@ -223,16 +222,12 @@ export class TerminalTabbedView extends Disposable {
}

private _createButton(): void {
const button = dom.$(ThemeIcon.asCSSSelector(newTerminalIcon), { tabindex: 0, role: 'button', title: nls.localize('addTerminal', "Create Terminal") });
button.classList.add('plus-button');

this._register(dom.addDisposableListener(button, dom.EventType.CLICK, async e => {
dom.EventHelper.stop(e);
await this._openTabsContextMenu(e);
}));

const actionBar = new ActionBar(this._tabTreeContainer);
actionBar.push(this._instantiationService.createInstance(MenuItemAction, { id: TERMINAL_COMMAND_ID.NEW, title: nls.localize('terminal.new', "New Terminal"), icon: Codicon.plus }, undefined, undefined), { icon: true, label: false });
const toolBar = new ToolBar(this._tabTreeContainer, this._contextMenuService);
toolBar.setActions([
this._instantiationService.createInstance(MenuItemAction, { id: TERMINAL_COMMAND_ID.NEW, title: nls.localize('terminal.new', "New Terminal"), icon: Codicon.plus }, undefined, undefined),
// TODO: Bring back context menu: await this._openTabsContextMenu(e);
this._instantiationService.createInstance(MenuItemAction, { id: TERMINAL_COMMAND_ID.NEW_WITH_PROFILE, title: nls.localize('terminal.newWithProfile', "New Terminal With Profile"), icon: Codicon.chevronDown }, undefined, undefined)
]);
}

private _updateTheme(theme?: IColorTheme): void {
Expand Down

0 comments on commit 94f637a

Please sign in to comment.