Skip to content

Commit 35be9af

Browse files
committed
clean up accessible view
1 parent 6aca75d commit 35be9af

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

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

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

2626
const enum DIMENSION_DEFAULT {
27-
WIDTH = .6,
28-
HEIGHT = 200
27+
WIDTH = 800
2928
}
3029

3130
export interface IAccessibleContentProvider {
@@ -88,14 +87,15 @@ class AccessibleView extends Disposable {
8887
quickSuggestions: false,
8988
renderWhitespace: 'none',
9089
dropIntoEditor: { enabled: true },
91-
readOnly: true
90+
readOnly: true,
91+
fontFamily: 'var(--monaco-monospace-font)'
9292
};
9393
this._editorWidget = this._register(this._instantiationService.createInstance(CodeEditorWidget, this._editorContainer, editorOptions, codeEditorWidgetOptions));
9494
}
9595

9696
show(provider: IAccessibleContentProvider): void {
9797
const delegate: IContextViewDelegate = {
98-
getAnchor: () => this._editorContainer,
98+
getAnchor: () => { return { x: (window.innerWidth / 2) - (DIMENSION_DEFAULT.WIDTH / 2), y: (window.innerHeight / 2) - (this.editorWidget.getContentHeight() / 2) }; },
9999
render: (container) => {
100100
return this._render(provider, container);
101101
},
@@ -161,11 +161,7 @@ class AccessibleView extends Disposable {
161161
}
162162

163163
private _layout(): void {
164-
const windowWidth = window.innerWidth;
165-
const width = windowWidth * DIMENSION_DEFAULT.WIDTH;
166-
this._editorWidget.layout({ width, height: this._editorWidget.getContentHeight() });
167-
const left = Math.round((windowWidth - width) / 2);
168-
this._editorContainer.style.left = `${left}px`;
164+
this._editorWidget.layout({ width: DIMENSION_DEFAULT.WIDTH, height: this._editorWidget.getContentHeight() });
169165
}
170166

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

src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
.accessible-view {
7-
position: relative;
7+
position: absolute;
88
background-color: var(--vscode-editorWidget-background);
99
color: var(--vscode-editorWidget-foreground);
1010
box-shadow: 0 2px 8px var(--vscode-widget-shadow);
11-
border: 2px solid var(--vscode-contrastActiveBorder);
11+
border: 2px solid var(--vscode-focusBorder);
1212
}

0 commit comments

Comments
 (0)