Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to move the Find dialog to the bottom of the document view #238345

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/vs/editor/browser/editorBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ export const enum OverlayWidgetPositionPreference {
/**
* Position the overlay widget in the top center
*/
TOP_CENTER
TOP_CENTER,

/**
* Position the overlay widget in the bottom center
*/
BOTTOM_CENTER
}


Expand Down
9 changes: 9 additions & 0 deletions src/vs/editor/contrib/find/browser/findWidget.css
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,12 @@
top: 5px;
right: 4px;
}

/* CSS styles for bottom position of the Find dialog */
.monaco-editor .find-widget.bottom {
transform: translateY(calc(100% + 10px)); /* shadow (10px) */
border-top: 1px solid var(--vscode-widget-border);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom: none;
}
6 changes: 6 additions & 0 deletions src/vs/editor/contrib/find/browser/findWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL

public getPosition(): IOverlayWidgetPosition | null {
if (this._isVisible) {
const dialogPosition = this._codeEditor.getOption(EditorOption.find).dialogPosition;
if (dialogPosition === 'bottom') {
return {
preference: OverlayWidgetPositionPreference.BOTTOM_CENTER
};
}
return {
preference: OverlayWidgetPositionPreference.TOP_RIGHT_CORNER
};
Expand Down