Skip to content

Commit 6dd720e

Browse files
authored
Merge pull request microsoft#187593 from microsoft/merogge/view-layout
position accessible view at the top
2 parents dd2273a + 42313dd commit 6dd720e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/vs/workbench/contrib/accessibility/browser/accessibleView.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
2323
import { SelectionClipboardContributionID } from 'vs/workbench/contrib/codeEditor/browser/selectionClipboard';
2424
import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
2525

26-
const enum DIMENSION_DEFAULT {
27-
WIDTH = 800
26+
const enum DEFAULT {
27+
WIDTH = 800,
28+
TOP = 25
2829
}
2930

3031
export interface IAccessibleContentProvider {
@@ -95,7 +96,7 @@ class AccessibleView extends Disposable {
9596

9697
show(provider: IAccessibleContentProvider): void {
9798
const delegate: IContextViewDelegate = {
98-
getAnchor: () => { return { x: (window.innerWidth / 2) - (DIMENSION_DEFAULT.WIDTH / 2), y: (window.innerHeight / 2) - (this.editorWidget.getContentHeight() / 2) }; },
99+
getAnchor: () => { return { x: (window.innerWidth / 2) - (DEFAULT.WIDTH / 2), y: DEFAULT.TOP }; },
99100
render: (container) => {
100101
return this._render(provider, container);
101102
},
@@ -161,7 +162,7 @@ class AccessibleView extends Disposable {
161162
}
162163

163164
private _layout(): void {
164-
this._editorWidget.layout({ width: DIMENSION_DEFAULT.WIDTH, height: this._editorWidget.getContentHeight() });
165+
this._editorWidget.layout({ width: DEFAULT.WIDTH, height: this._editorWidget.getContentHeight() });
165166
}
166167

167168
private async _getTextModel(resource: URI): Promise<ITextModel | null> {

0 commit comments

Comments
 (0)