notebook find replace position vs global toolbar (#236407)

* notebook find replace position vs global toolbar

* use runAndSubscribe
pull/236427/head
Michael Lively 2024-12-17 13:34:38 -08:00 committed by GitHub
parent 999f28e49f
commit b0e6e13be6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import { Widget } from '../../../../../../base/browser/ui/widget.js';
import { Action, ActionRunner, IAction, IActionRunner, Separator } from '../../../../../../base/common/actions.js';
import { Delayer } from '../../../../../../base/common/async.js';
import { Codicon } from '../../../../../../base/common/codicons.js';
import { Event } from '../../../../../../base/common/event.js';
import { KeyCode } from '../../../../../../base/common/keyCodes.js';
import { Disposable } from '../../../../../../base/common/lifecycle.js';
import { isSafari } from '../../../../../../base/common/platform.js';
@ -345,6 +346,17 @@ export abstract class SimpleFindReplaceWidget extends Widget {
this._domNode = document.createElement('div');
this._domNode.classList.add('simple-fr-find-part-wrapper');
this._register(Event.runAndSubscribe(this._configurationService.onDidChangeConfiguration, e => {
if (!e || e.affectsConfiguration(NotebookSetting.globalToolbar)) {
if (this._notebookEditor.notebookOptions.getLayoutConfiguration().globalToolbar) {
this._domNode.style.top = '26px';
} else {
this._domNode.style.top = '0px';
}
}
}));
this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));
this._scopedContextKeyService = contextKeyService.createScoped(this._domNode);