Skip to content

Commit fa35e8d

Browse files
committed
fix layout issue
1 parent 2c9da74 commit fa35e8d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/
2424
import { IDisposable } from 'xterm';
2525

2626
const enum DIMENSION_DEFAULT {
27-
WIDTH = .4,
28-
HEIGHT = .2
27+
WIDTH = .6,
28+
HEIGHT = 200
2929
}
3030

3131
export interface IAccessibleContentProvider {
@@ -125,7 +125,6 @@ class AccessibleView extends Disposable {
125125
model.setLanguage(provider.options.language);
126126
}
127127
container.appendChild(this._editorContainer);
128-
this._layout();
129128
this._register(this._editorWidget.onKeyUp((e) => {
130129
if (e.keyCode === KeyCode.Escape) {
131130
this._contextViewService.hideContextView();
@@ -149,13 +148,8 @@ class AccessibleView extends Disposable {
149148

150149
private _layout(): void {
151150
const windowWidth = window.innerWidth;
152-
const windowHeight = window.innerHeight;
153-
154151
const width = windowWidth * DIMENSION_DEFAULT.WIDTH;
155-
const height = Math.min(windowHeight * DIMENSION_DEFAULT.HEIGHT, this._editorWidget.getContentHeight());
156-
this._editorWidget.layout({ width, height });
157-
const top = Math.round((windowHeight - height) / 2);
158-
this._editorContainer.style.top = `${top}px`;
152+
this._editorWidget.layout({ width, height: this._editorWidget.getContentHeight() });
159153
const left = Math.round((windowWidth - width) / 2);
160154
this._editorContainer.style.left = `${left}px`;
161155
}

0 commit comments

Comments
 (0)