differenciate onFocusWidget and onFocusWebview.

This commit is contained in:
rebornix
2021-11-12 14:35:50 -08:00
parent ad88550b9e
commit 8fdb5bc4e6
5 changed files with 8 additions and 8 deletions

View File

@@ -131,7 +131,7 @@ export class MainThreadNotebooksAndEditors {
private _handleEditorAdd(editor: INotebookEditor): void { private _handleEditorAdd(editor: INotebookEditor): void {
this._editorListeners.set(editor.getId(), combinedDisposable( this._editorListeners.set(editor.getId(), combinedDisposable(
editor.onDidChangeModel(() => this._updateState()), editor.onDidChangeModel(() => this._updateState()),
editor.onDidFocus(() => this._updateState(editor)), editor.onDidFocusWidget(() => this._updateState(editor)),
)); ));
this._updateState(); this._updateState();
} }

View File

@@ -322,7 +322,7 @@ export class InteractiveEditor extends EditorPane {
this.#notebookWidget.value!.setOptions({ this.#notebookWidget.value!.setOptions({
isReadOnly: true isReadOnly: true
}); });
this.#widgetDisposableStore.add(this.#notebookWidget.value!.onDidFocus(() => this.#onDidFocusWidget.fire())); this.#widgetDisposableStore.add(this.#notebookWidget.value!.onDidFocusWidget(() => this.#onDidFocusWidget.fire()));
this.#widgetDisposableStore.add(model.notebook.onDidChangeContent(() => { this.#widgetDisposableStore.add(model.notebook.onDidChangeContent(() => {
(model as ComplexNotebookEditorModel).setDirty(false); (model as ComplexNotebookEditorModel).setDirty(false);
})); }));

View File

@@ -398,8 +398,8 @@ export interface INotebookEditor {
* An event emitted when the model of this editor has changed. * An event emitted when the model of this editor has changed.
*/ */
readonly onDidChangeModel: Event<NotebookTextModel | undefined>; readonly onDidChangeModel: Event<NotebookTextModel | undefined>;
readonly onDidFocus: Event<void>; readonly onDidFocusWidget: Event<void>;
readonly onDidBlur: Event<void>; readonly onDidBlurWidget: Event<void>;
readonly onDidScroll: Event<void>; readonly onDidScroll: Event<void>;
readonly onDidChangeActiveCell: Event<void>; readonly onDidChangeActiveCell: Event<void>;
readonly onDidChangeActiveKernel: Event<void>; readonly onDidChangeActiveKernel: Event<void>;

View File

@@ -225,8 +225,8 @@ export class NotebookEditor extends EditorPane {
await this._widget.value!.setModel(model.notebook, viewState); await this._widget.value!.setModel(model.notebook, viewState);
const isReadOnly = input.hasCapability(EditorInputCapabilities.Readonly); const isReadOnly = input.hasCapability(EditorInputCapabilities.Readonly);
await this._widget.value!.setOptions({ ...options, isReadOnly }); await this._widget.value!.setOptions({ ...options, isReadOnly });
this._widgetDisposableStore.add(this._widget.value!.onDidFocus(() => this._onDidFocusWidget.fire())); this._widgetDisposableStore.add(this._widget.value!.onDidFocusWidget(() => this._onDidFocusWidget.fire()));
this._widgetDisposableStore.add(this._widget.value!.onDidBlur(() => this._onDidBlurWidget.fire())); this._widgetDisposableStore.add(this._widget.value!.onDidBlurWidget(() => this._onDidBlurWidget.fire()));
this._widgetDisposableStore.add(this._editorDropService.createEditorDropTarget(this._widget.value!.getDomNode(), { this._widgetDisposableStore.add(this._editorDropService.createEditorDropTarget(this._widget.value!.getDomNode(), {
containsGroup: (group) => this.group?.id === group.id containsGroup: (group) => this.group?.id === group.id

View File

@@ -276,9 +276,9 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
private readonly _onDidChangeVisibleRanges = this._register(new Emitter<void>()); private readonly _onDidChangeVisibleRanges = this._register(new Emitter<void>());
readonly onDidChangeVisibleRanges: Event<void> = this._onDidChangeVisibleRanges.event; readonly onDidChangeVisibleRanges: Event<void> = this._onDidChangeVisibleRanges.event;
private readonly _onDidFocusEmitter = this._register(new Emitter<void>()); private readonly _onDidFocusEmitter = this._register(new Emitter<void>());
readonly onDidFocus = this._onDidFocusEmitter.event; readonly onDidFocusWidget = this._onDidFocusEmitter.event;
private readonly _onDidBlurEmitter = this._register(new Emitter<void>()); private readonly _onDidBlurEmitter = this._register(new Emitter<void>());
readonly onDidBlur = this._onDidBlurEmitter.event; readonly onDidBlurWidget = this._onDidBlurEmitter.event;
private readonly _onDidChangeActiveEditor = this._register(new Emitter<this>()); private readonly _onDidChangeActiveEditor = this._register(new Emitter<this>());
readonly onDidChangeActiveEditor: Event<this> = this._onDidChangeActiveEditor.event; readonly onDidChangeActiveEditor: Event<this> = this._onDidChangeActiveEditor.event;
private readonly _onDidChangeActiveKernel = this._register(new Emitter<void>()); private readonly _onDidChangeActiveKernel = this._register(new Emitter<void>());