提交 47813a3e 编写于 作者: S SteVen Batten

run and debug views can move

refs #90468
上级 543b36d9
...@@ -243,11 +243,13 @@ export class WorkbenchList<T> extends List<T> { ...@@ -243,11 +243,13 @@ export class WorkbenchList<T> extends List<T> {
readonly contextKeyService: IContextKeyService; readonly contextKeyService: IContextKeyService;
private readonly configurationService: IConfigurationService; private readonly configurationService: IConfigurationService;
private readonly themeService: IThemeService;
private listHasSelectionOrFocus: IContextKey<boolean>; private listHasSelectionOrFocus: IContextKey<boolean>;
private listDoubleSelection: IContextKey<boolean>; private listDoubleSelection: IContextKey<boolean>;
private listMultiSelection: IContextKey<boolean>; private listMultiSelection: IContextKey<boolean>;
private _styler: IDisposable | undefined;
private _useAltAsMultipleSelectionModifier: boolean; private _useAltAsMultipleSelectionModifier: boolean;
constructor( constructor(
...@@ -278,6 +280,7 @@ export class WorkbenchList<T> extends List<T> { ...@@ -278,6 +280,7 @@ export class WorkbenchList<T> extends List<T> {
this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
this.configurationService = configurationService; this.configurationService = configurationService;
this.themeService = themeService;
const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService);
listSupportsMultiSelect.set(!(options.multipleSelectionSupport === false)); listSupportsMultiSelect.set(!(options.multipleSelectionSupport === false));
...@@ -292,7 +295,7 @@ export class WorkbenchList<T> extends List<T> { ...@@ -292,7 +295,7 @@ export class WorkbenchList<T> extends List<T> {
this.disposables.add((listService as ListService).register(this)); this.disposables.add((listService as ListService).register(this));
if (options.overrideStyles) { if (options.overrideStyles) {
this.disposables.add(attachListStyler(this, themeService, options.overrideStyles)); this.updateStyles(options.overrideStyles);
} }
this.disposables.add(this.onSelectionChange(() => { this.disposables.add(this.onSelectionChange(() => {
...@@ -313,6 +316,29 @@ export class WorkbenchList<T> extends List<T> { ...@@ -313,6 +316,29 @@ export class WorkbenchList<T> extends List<T> {
this.registerListeners(); this.registerListeners();
} }
updateOptions(options: IWorkbenchListOptions<T>): void {
super.updateOptions(options);
if (options.overrideStyles) {
this.updateStyles(options.overrideStyles);
}
}
dispose(): void {
super.dispose();
if (this._styler) {
this._styler.dispose();
}
}
private updateStyles(styles: IColorMapping): void {
if (this._styler) {
this._styler.dispose();
}
this._styler = attachListStyler(this, this.themeService, styles);
}
private registerListeners(): void { private registerListeners(): void {
this.disposables.add(this.configurationService.onDidChangeConfiguration(e => { this.disposables.add(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(multiSelectModifierSettingKey)) { if (e.affectsConfiguration(multiSelectModifierSettingKey)) {
...@@ -775,6 +801,14 @@ export class WorkbenchCompressibleObjectTree<T extends NonNullable<any>, TFilter ...@@ -775,6 +801,14 @@ export class WorkbenchCompressibleObjectTree<T extends NonNullable<any>, TFilter
this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService); this.internals = new WorkbenchTreeInternals(this, treeOptions, getAutomaticKeyboardNavigation, options.overrideStyles, contextKeyService, listService, themeService, configurationService, accessibilityService);
this.disposables.add(this.internals); this.disposables.add(this.internals);
} }
updateOptions(options: IWorkbenchAsyncDataTreeOptions<T, TFilterData> = {}): void {
super.updateOptions(options);
if (options.overrideStyles) {
this.internals.updateStyleOverrides(options.overrideStyles);
}
}
} }
export interface IWorkbenchDataTreeOptions<T, TFilterData> extends IDataTreeOptions<T, TFilterData> { export interface IWorkbenchDataTreeOptions<T, TFilterData> extends IDataTreeOptions<T, TFilterData> {
......
...@@ -31,7 +31,6 @@ import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/ ...@@ -31,7 +31,6 @@ import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { ILabelService } from 'vs/platform/label/common/label'; import { ILabelService } from 'vs/platform/label/common/label';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { Gesture } from 'vs/base/browser/touch'; import { Gesture } from 'vs/base/browser/touch';
import { IViewDescriptorService } from 'vs/workbench/common/views'; import { IViewDescriptorService } from 'vs/workbench/common/views';
import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'; import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';
...@@ -102,7 +101,7 @@ export class BreakpointsView extends ViewPane { ...@@ -102,7 +101,7 @@ export class BreakpointsView extends ViewPane {
isChecked: (breakpoint: IEnablement) => breakpoint.enabled isChecked: (breakpoint: IEnablement) => breakpoint.enabled
}, },
overrideStyles: { overrideStyles: {
listBackground: SIDE_BAR_BACKGROUND listBackground: this.getBackgroundColor()
} }
}); });
...@@ -154,6 +153,12 @@ export class BreakpointsView extends ViewPane { ...@@ -154,6 +153,12 @@ export class BreakpointsView extends ViewPane {
this.onBreakpointsChange(); this.onBreakpointsChange();
} }
})); }));
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
if (views.some(v => v.id === this.id)) {
this.list.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
}
}));
} }
public focus(): void { public focus(): void {
......
...@@ -34,7 +34,6 @@ import { isSessionAttach } from 'vs/workbench/contrib/debug/common/debugUtils'; ...@@ -34,7 +34,6 @@ import { isSessionAttach } from 'vs/workbench/contrib/debug/common/debugUtils';
import { STOP_ID, STOP_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, RESTART_SESSION_ID, RESTART_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, PAUSE_ID, PAUSE_LABEL, CONTINUE_ID, CONTINUE_LABEL } from 'vs/workbench/contrib/debug/browser/debugCommands'; import { STOP_ID, STOP_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, RESTART_SESSION_ID, RESTART_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, PAUSE_ID, PAUSE_LABEL, CONTINUE_ID, CONTINUE_LABEL } from 'vs/workbench/contrib/debug/browser/debugCommands';
import { ICommandService } from 'vs/platform/commands/common/commands'; import { ICommandService } from 'vs/platform/commands/common/commands';
import { CollapseAction } from 'vs/workbench/browser/viewlet'; import { CollapseAction } from 'vs/workbench/browser/viewlet';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IViewDescriptorService } from 'vs/workbench/common/views'; import { IViewDescriptorService } from 'vs/workbench/common/views';
import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
...@@ -203,7 +202,7 @@ export class CallStackView extends ViewPane { ...@@ -203,7 +202,7 @@ export class CallStackView extends ViewPane {
}, },
expandOnlyOnTwistieClick: true, expandOnlyOnTwistieClick: true,
overrideStyles: { overrideStyles: {
listBackground: SIDE_BAR_BACKGROUND listBackground: this.getBackgroundColor()
} }
}); });
...@@ -296,6 +295,12 @@ export class CallStackView extends ViewPane { ...@@ -296,6 +295,12 @@ export class CallStackView extends ViewPane {
this.parentSessionToExpand.add(s.parentSession); this.parentSessionToExpand.add(s.parentSession);
} }
})); }));
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
if (views.some(v => v.id === this.id)) {
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
}
}));
} }
layoutBody(height: number, width: number): void { layoutBody(height: number, width: number): void {
......
...@@ -104,12 +104,12 @@ Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{ ...@@ -104,12 +104,12 @@ Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
// Register default debug views // Register default debug views
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry); const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer); viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer); viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer); viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer); viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
viewsRegistry.registerViews([{ id: StartView.ID, name: StartView.LABEL, ctorDescriptor: new SyncDescriptor(StartView), order: 10, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer); viewsRegistry.registerViews([{ id: StartView.ID, name: StartView.LABEL, ctorDescriptor: new SyncDescriptor(StartView), order: 10, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer); viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
registerCommands(); registerCommands();
......
...@@ -34,7 +34,6 @@ import { dispose } from 'vs/base/common/lifecycle'; ...@@ -34,7 +34,6 @@ import { dispose } from 'vs/base/common/lifecycle';
import { createMatches, FuzzyScore } from 'vs/base/common/filters'; import { createMatches, FuzzyScore } from 'vs/base/common/filters';
import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider'; import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider';
import { ILabelService } from 'vs/platform/label/common/label'; import { ILabelService } from 'vs/platform/label/common/label';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import type { ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel'; import type { ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel';
import type { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree'; import type { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree';
import { IViewDescriptorService } from 'vs/workbench/common/views'; import { IViewDescriptorService } from 'vs/workbench/common/views';
...@@ -472,7 +471,7 @@ export class LoadedScriptsView extends ViewPane { ...@@ -472,7 +471,7 @@ export class LoadedScriptsView extends ViewPane {
accessibilityProvider: new LoadedSciptsAccessibilityProvider(), accessibilityProvider: new LoadedSciptsAccessibilityProvider(),
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'loadedScriptsAriaLabel' }, "Debug Loaded Scripts"), ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'loadedScriptsAriaLabel' }, "Debug Loaded Scripts"),
overrideStyles: { overrideStyles: {
listBackground: SIDE_BAR_BACKGROUND listBackground: this.getBackgroundColor()
} }
} }
); );
...@@ -574,6 +573,12 @@ export class LoadedScriptsView extends ViewPane { ...@@ -574,6 +573,12 @@ export class LoadedScriptsView extends ViewPane {
} }
})); }));
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
if (views.some(v => v.id === this.id)) {
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
}
}));
// feature: expand all nodes when filtering (not when finding) // feature: expand all nodes when filtering (not when finding)
let viewState: IViewState | undefined; let viewState: IViewState | undefined;
this._register(this.tree.onDidChangeTypeFilterPattern(pattern => { this._register(this.tree.onDidChangeTypeFilterPattern(pattern => {
......
...@@ -30,7 +30,6 @@ import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabe ...@@ -30,7 +30,6 @@ import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabe
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { dispose } from 'vs/base/common/lifecycle'; import { dispose } from 'vs/base/common/lifecycle';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IViewDescriptorService } from 'vs/workbench/common/views'; import { IViewDescriptorService } from 'vs/workbench/common/views';
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
...@@ -102,7 +101,7 @@ export class VariablesView extends ViewPane { ...@@ -102,7 +101,7 @@ export class VariablesView extends ViewPane {
identityProvider: { getId: (element: IExpression | IScope) => element.getId() }, identityProvider: { getId: (element: IExpression | IScope) => element.getId() },
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IExpression | IScope) => e }, keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IExpression | IScope) => e },
overrideStyles: { overrideStyles: {
listBackground: SIDE_BAR_BACKGROUND listBackground: this.getBackgroundColor()
} }
}); });
...@@ -148,6 +147,11 @@ export class VariablesView extends ViewPane { ...@@ -148,6 +147,11 @@ export class VariablesView extends ViewPane {
this.tree.rerender(e); this.tree.rerender(e);
} }
})); }));
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
if (views.some(v => v.id === this.id)) {
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
}
}));
} }
layoutBody(width: number, height: number): void { layoutBody(width: number, height: number): void {
......
...@@ -30,7 +30,6 @@ import { IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel ...@@ -30,7 +30,6 @@ import { IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel
import { variableSetEmitter, VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView'; import { variableSetEmitter, VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { dispose } from 'vs/base/common/lifecycle'; import { dispose } from 'vs/base/common/lifecycle';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IViewDescriptorService } from 'vs/workbench/common/views'; import { IViewDescriptorService } from 'vs/workbench/common/views';
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
...@@ -89,7 +88,7 @@ export class WatchExpressionsView extends ViewPane { ...@@ -89,7 +88,7 @@ export class WatchExpressionsView extends ViewPane {
}, },
dnd: new WatchExpressionsDragAndDrop(this.debugService), dnd: new WatchExpressionsDragAndDrop(this.debugService),
overrideStyles: { overrideStyles: {
listBackground: SIDE_BAR_BACKGROUND listBackground: this.getBackgroundColor()
} }
}); });
...@@ -146,6 +145,11 @@ export class WatchExpressionsView extends ViewPane { ...@@ -146,6 +145,11 @@ export class WatchExpressionsView extends ViewPane {
this.tree.rerender(e); this.tree.rerender(e);
} }
})); }));
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
if (views.some(v => v.id === this.id)) {
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
}
}));
} }
layoutBody(height: number, width: number): void { layoutBody(height: number, width: number): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册