提交 5383f489 编写于 作者: J Johannes Rieken

debt - adopt label service in breadcrumbs control

上级 9bd1b18a
......@@ -47,6 +47,7 @@ import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService
import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor';
import { onDidChangeZoomLevel } from 'vs/base/browser/browser';
import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types';
import { ILabelService } from 'vs/platform/label/common/label';
class Item extends BreadcrumbsItem {
......@@ -167,6 +168,7 @@ export class BreadcrumbsControl {
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IFileService private readonly _fileService: IFileService,
@ITelemetryService private readonly _telemetryService: ITelemetryService,
@ILabelService private readonly _labelService: ILabelService,
@IBreadcrumbsService breadcrumbsService: IBreadcrumbsService,
) {
this.domNode = document.createElement('div');
......@@ -238,16 +240,18 @@ export class BreadcrumbsControl {
this._ckBreadcrumbsVisible.set(true);
this._ckBreadcrumbsPossible.set(true);
let editor = this._getActiveCodeEditor();
let model = new EditorBreadcrumbsModel(input.getResource()!, editor, this._workspaceService, this._configurationService);
const uri = input.getResource()!;
const editor = this._getActiveCodeEditor();
const model = new EditorBreadcrumbsModel(uri, editor, this._workspaceService, this._configurationService);
dom.toggleClass(this.domNode, 'relative-path', model.isRelative());
dom.toggleClass(this.domNode, 'backslash-path', this._labelService.getSeparator(uri.scheme, uri.authority) === '\\');
let updateBreadcrumbs = () => {
let items = model.getElements().map(element => new Item(element, this._options, this._instantiationService));
const updateBreadcrumbs = () => {
const items = model.getElements().map(element => new Item(element, this._options, this._instantiationService));
this._widget.setItems(items);
this._widget.reveal(items[items.length - 1]);
};
let listener = model.onDidUpdate(updateBreadcrumbs);
const listener = model.onDidUpdate(updateBreadcrumbs);
updateBreadcrumbs();
this._breadcrumbsDisposables = [model, listener];
......
......@@ -54,7 +54,7 @@
background-image: none;
}
.monaco-workbench.windows .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item::before {
.monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control.backslash-path .monaco-breadcrumb-item::before {
content: '\\';
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册