提交 41f47cc2 编写于 作者: B Benjamin Pasero

grid - some 💄

上级 e33ea819
......@@ -59,7 +59,6 @@
cursor: -webkit-grab;
}
/* Actions */
.monaco-workbench > .part.editor > .content .editor-group-container > .title .close-editor-action {
......
......@@ -144,14 +144,8 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
// Container
addClasses(this.element, 'editor-group-container');
// Open new file via doubleclick on container
this._register(addDisposableListener(this.element, EventType.DBLCLICK, e => {
if (e.target === this.element) {
EventHelper.stop(e);
this.openEditor(this.untitledEditorService.createOrGet(), EditorOptions.create({ pinned: true }));
}
}));
// Container listeners
this.registerContainerListeners();
// Container toolbar
this.createContainerToolbar();
......@@ -194,6 +188,18 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
this.updateStyles();
}
private registerContainerListeners(): void {
// Open new file via doubleclick on container
this._register(addDisposableListener(this.element, EventType.DBLCLICK, e => {
if (e.target === this.element) {
EventHelper.stop(e);
this.openEditor(this.untitledEditorService.createOrGet(), EditorOptions.create({ pinned: true }));
}
}));
}
private createContainerToolbar(): void {
// Toolbar Container
......@@ -261,7 +267,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
private updateContainer(): void {
// Empty Container: allow to focus
// Empty Container: add some empty container attributes
if (this.isEmpty()) {
addClass(this.element, 'empty');
this.element.tabIndex = 0;
......
......@@ -30,7 +30,7 @@ export class NextNoTabsTitleControl extends NextTitleControl {
this.titleContainer.draggable = true;
//Container listeners
this.hookContainerListeners();
this.registerContainerListeners();
// Gesture Support
Gesture.addTarget(this.titleContainer);
......@@ -48,7 +48,7 @@ export class NextNoTabsTitleControl extends NextTitleControl {
this.createEditorActionsToolBar(actionsContainer);
}
private hookContainerListeners(): void {
private registerContainerListeners(): void {
// Drag start
this._register(addDisposableListener(this.titleContainer, EventType.DRAG_START, (e: DragEvent) => {
......@@ -67,7 +67,7 @@ export class NextNoTabsTitleControl extends NextTitleControl {
}
// Drag Image
applyDragImage(e, this.group.count === 1 ? localize('oneEditor', "1 editor") : localize('multipleEditor', "{0} editors", this.group.count), 'monaco-editor-group-drag-image');
applyDragImage(e, localize('editorGroup', "Editor Group"), 'monaco-editor-group-drag-image');
}));
// Drag end
......
......@@ -98,7 +98,7 @@ export class NextTabsTitleControl extends NextTitleControl {
addClass(this.tabsContainer, 'tabs-container');
// Tabs Container listeners
this.hookContainerListeners();
this.registerContainerListeners();
// Scrollbar
this.createScrollbar();
......@@ -130,7 +130,7 @@ export class NextTabsTitleControl extends NextTitleControl {
this.titleContainer.appendChild(this.scrollbar.getDomNode());
}
private hookContainerListeners(): void {
private registerContainerListeners(): void {
// Forward scrolling inside the container to our custom scrollbar
this._register(addDisposableListener(this.tabsContainer, EventType.SCROLL, () => {
......@@ -168,7 +168,7 @@ export class NextTabsTitleControl extends NextTitleControl {
e.dataTransfer.effectAllowed = 'copyMove';
// Drag Image
applyDragImage(e, this.group.count === 1 ? localize('oneEditor', "1 editor") : localize('multipleEditor', "{0} editors", this.group.count), 'monaco-editor-group-drag-image');
applyDragImage(e, localize('editorGroup', "Editor Group"), 'monaco-editor-group-drag-image');
}));
// Drag enter
......@@ -414,14 +414,14 @@ export class NextTabsTitleControl extends NextTitleControl {
actionBar.onDidBeforeRun(() => this.blockRevealActiveTabOnce());
// Eventing
const eventsDisposable = this.hookTabListeners(tabContainer, index);
const eventsDisposable = this.registerTabListeners(tabContainer, index);
this.tabDisposeables.push(combinedDisposable([eventsDisposable, actionBar, actionRunner, editorLabel]));
return tabContainer;
}
private hookTabListeners(tab: HTMLElement, index: number): IDisposable {
private registerTabListeners(tab: HTMLElement, index: number): IDisposable {
const disposables: IDisposable[] = [];
const handleClickOrTouch = (e: MouseEvent | GestureEvent): void => {
......
......@@ -245,7 +245,7 @@ export class EditorGroup extends Disposable implements IEditorGroup {
}
// Listeners
this.hookEditorListeners(editor);
this.registerEditorListeners(editor);
// Event
this._onDidEditorOpen.fire(editor);
......@@ -276,7 +276,7 @@ export class EditorGroup extends Disposable implements IEditorGroup {
}
}
private hookEditorListeners(editor: EditorInput): void {
private registerEditorListeners(editor: EditorInput): void {
const unbind: IDisposable[] = [];
// Re-emit disposal of editor input as our own event
......@@ -667,7 +667,7 @@ export class EditorGroup extends Disposable implements IEditorGroup {
if (factory) {
const editor = factory.deserialize(this.instantiationService, e.value);
this.hookEditorListeners(editor);
this.registerEditorListeners(editor);
this.updateResourceMap(editor, false /* add */);
return editor;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册