From b0e6e13be600c35f7444f16b4c5f59eb503ec2f1 Mon Sep 17 00:00:00 2001 From: Michael Lively Date: Tue, 17 Dec 2024 13:34:38 -0800 Subject: [PATCH] notebook find replace position vs global toolbar (#236407) * notebook find replace position vs global toolbar * use runAndSubscribe --- .../contrib/find/notebookFindReplaceWidget.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.ts b/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.ts index 6e8651a4a32..8509900d4b0 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.ts @@ -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);