提交 53f524a5 编写于 作者: B Benjamin Pasero

no tabs: dirty over close action

上级 07af5660
......@@ -3,33 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/* Title Decoration */
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .title-decoration {
width: 18px;
padding-left: 2px;
opacity: 0.5;
}
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.active .title-decoration {
opacity: 1;
}
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .title-decoration.dirty {
background-size: 16px;
background-position: left center;
background-repeat: no-repeat;
}
.vs .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .title-decoration.dirty {
background: url('close-dirty.svg') center center no-repeat;
}
.hc-black .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .title-decoration.dirty,
.vs-dark .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .title-decoration.dirty {
background: url('close-dirty-inverse.svg') center center no-repeat;
}
/* Title Label */
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .title-label {
......@@ -37,7 +10,7 @@
overflow: hidden;
text-overflow: ellipsis;
position: relative;
padding-left: 2px;
padding-left: 20px;
}
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .monaco-icon-label::before {
......@@ -53,4 +26,13 @@
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.active .title-actions {
opacity: 1;
}
.vs .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.dirty .title-actions .close-editor-action {
background: url('close-dirty.svg') center center no-repeat;
}
.vs-dark .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.dirty .title-actions .close-editor-action,
.hc-black .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.dirty .title-actions .close-editor-action {
background: url('close-dirty-inverse.svg') center center no-repeat;
}
\ No newline at end of file
......@@ -14,7 +14,6 @@ import {EditorLabel} from 'vs/workbench/browser/labels';
export class NoTabsTitleControl extends TitleControl {
private titleContainer: HTMLElement;
private titleDecoration: HTMLElement;
private editorLabel: EditorLabel;
public setContext(group: IEditorGroup): void {
......@@ -34,11 +33,6 @@ export class NoTabsTitleControl extends TitleControl {
// Detect mouse click
this.toDispose.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.MOUSE_UP, (e: MouseEvent) => this.onTitleClick(e)));
// Left Title Decoration
this.titleDecoration = document.createElement('div');
DOM.addClass(this.titleDecoration, 'title-decoration');
this.titleContainer.appendChild(this.titleDecoration);
// Editor Label
this.editorLabel = this.instantiationService.createInstance(EditorLabel, this.titleContainer, void 0);
this.toDispose.push(this.editorLabel);
......@@ -114,6 +108,13 @@ export class NoTabsTitleControl extends TitleControl {
DOM.removeClass(this.titleContainer, 'active');
}
// Dirty state
if (editor.isDirty()) {
DOM.addClass(this.titleContainer, 'dirty');
} else {
DOM.removeClass(this.titleContainer, 'dirty');
}
// Editor Label
const resource = getResource(editor);
const name = editor.getName() || '';
......@@ -125,13 +126,6 @@ export class NoTabsTitleControl extends TitleControl {
this.editorLabel.setLabel({ name, description, resource}, { title: verboseDescription, italic: !isPinned, extraClasses: ['title-label'] });
// Editor Decoration
if (editor.isDirty()) {
DOM.addClass(this.titleDecoration, 'dirty');
} else {
DOM.removeClass(this.titleDecoration, 'dirty');
}
// Update Editor Actions Toolbar
this.updateEditorActionsToolbar();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册