提交 715e513e 编写于 作者: S SteVen Batten

refs #92786 allow repl move

上级 1d6972eb
......@@ -21,8 +21,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { Event, Emitter } from 'vs/base/common/event';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
import { IThemeService, IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
import { SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_BORDER, SIDE_BAR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { EventType, addDisposableListener, trackFocus } from 'vs/base/browser/dom';
......@@ -333,6 +333,23 @@ class FocusSideBarAction extends Action {
}
}
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
// Sidebar Background: since views can host editors, we apply a background rule if the sidebar background
// color is different from the editor background color. This is a bit of a hack though. The better way
// would be to have a way to push the background color onto each editor widget itself somehow.
const sidebarBackground = theme.getColor(SIDE_BAR_BACKGROUND);
if (sidebarBackground && sidebarBackground !== theme.getColor(editorBackground)) {
collector.addRule(`
.monaco-workbench .part.sidebar > .content .monaco-editor,
.monaco-workbench .part.sidebar > .content .monaco-editor .margin,
.monaco-workbench .part.sidebar > .content .monaco-editor .monaco-editor-background {
background-color: ${sidebarBackground};
}
`);
}
});
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(SyncActionDescriptor.create(FocusSideBarAction, FocusSideBarAction.ID, FocusSideBarAction.LABEL, {
primary: KeyMod.CtrlCmd | KeyCode.KEY_0
......
......@@ -95,13 +95,15 @@ const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewE
focusCommand: {
id: OpenDebugPanelAction.ID,
keybindings: openPanelKb
}
},
hideIfEmpty: true
}, ViewContainerLocation.Panel);
Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
id: REPL_VIEW_ID,
name: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, 'Debug Console'),
canToggleVisibility: false,
canMoveView: true,
ctorDescriptor: new SyncDescriptor(Repl),
}], VIEW_CONTAINER);
......
......@@ -495,7 +495,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
setRowLineHeight: false,
supportDynamicHeights: wordWrap,
overrideStyles: {
listBackground: PANEL_BACKGROUND
listBackground: this.getBackgroundColor()
}
});
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册