提交 3320a003 编写于 作者: S SteVen Batten

enable comments panel move

上级 3b155031
......@@ -452,6 +452,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
id: COMMENTS_VIEW_ID,
name: COMMENTS_VIEW_TITLE,
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [COMMENTS_VIEW_ID, COMMENTS_VIEW_TITLE, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
hideIfEmpty: true,
order: 10,
}, ViewContainerLocation.Panel);
......@@ -460,6 +461,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
name: COMMENTS_VIEW_TITLE,
canToggleVisibility: false,
ctorDescriptor: new SyncDescriptor(CommentsPanel),
canMoveView: true,
focusCommand: {
id: 'workbench.action.focusCommentsPanel'
}
......
......@@ -20,7 +20,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/listService';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { PANEL_BACKGROUND } from 'vs/workbench/common/theme';
import { IColorMapping } from 'vs/platform/theme/common/styler';
export const COMMENTS_VIEW_ID = 'workbench.panel.comments';
export const COMMENTS_VIEW_TITLE = 'Comments';
......@@ -149,10 +149,15 @@ export class CommentNodeRenderer implements IListRenderer<ITreeNode<CommentNode>
}
}
export interface ICommentsListOptions {
overrideStyles?: IColorMapping;
}
export class CommentsList extends WorkbenchAsyncDataTree<any, any> {
constructor(
labels: ResourceLabels,
container: HTMLElement,
options: ICommentsListOptions,
@IContextKeyService contextKeyService: IContextKeyService,
@IListService listService: IListService,
@IThemeService themeService: IThemeService,
......@@ -202,9 +207,7 @@ export class CommentsList extends WorkbenchAsyncDataTree<any, any> {
collapseByDefault: () => {
return false;
},
overrideStyles: {
listBackground: PANEL_BACKGROUND
}
overrideStyles: options.overrideStyles
},
contextKeyService,
listService,
......
......@@ -149,7 +149,7 @@ export class CommentsPanel extends ViewPane {
private createTree(): void {
this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, this));
this.tree = this._register(this.instantiationService.createInstance(CommentsList, this.treeLabels, this.treeContainer));
this.tree = this._register(this.instantiationService.createInstance(CommentsList, this.treeLabels, this.treeContainer, { overrideStyles: { listBackground: this.getBackgroundColor() } }));
const commentsNavigator = this._register(ResourceNavigator.createTreeResourceNavigator(this.tree, { openOnFocus: true }));
this._register(commentsNavigator.onDidOpenResource(e => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册