Skip to content

Commit 6c0a794

Browse files
authored
Merge pull request microsoft#184945 from microsoft/merogge/inline-outline
add border to `AccessibleView`
2 parents b8fe761 + 69defec commit 6c0a794

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/
2222
import { IDisposable } from 'xterm';
2323

2424

25-
export interface IAccessibleContentProvider { id: string; provideContent(): string; onClose(): void; onKeyDown?(e: IKeyboardEvent): void; options: IAccessibleViewOptions }
25+
export interface IAccessibleContentProvider {
26+
id: string;
27+
provideContent(): string;
28+
onClose(): void;
29+
onKeyDown?(e: IKeyboardEvent): void;
30+
options: IAccessibleViewOptions;
31+
}
32+
2633
export const IAccessibleViewService = createDecorator<IAccessibleViewService>('accessibleViewService');
2734

2835
export interface IAccessibleViewService {
@@ -96,7 +103,7 @@ class AccessibleView extends Disposable {
96103
if (!domNode) {
97104
return;
98105
}
99-
container.appendChild(domNode);
106+
container.appendChild(this._editorContainer);
100107
this._layout();
101108
this._register(this._editorWidget.onKeyDown((e) => {
102109
if (e.keyCode === KeyCode.Escape) {
@@ -113,21 +120,16 @@ class AccessibleView extends Disposable {
113120
}
114121

115122
private _layout(): void {
116-
const domNode = this._editorWidget.getDomNode();
117-
if (!domNode) {
118-
return;
119-
}
120-
121123
const windowWidth = window.innerWidth;
122124
const windowHeight = window.innerHeight;
123125

124126
const width = windowWidth * .4;
125127
const height = Math.min(.4 * windowHeight, this._editorWidget.getContentHeight());
126128
this._editorWidget.layout({ width, height });
127129
const top = Math.round((windowHeight - height) / 2);
128-
domNode.style.top = `${top}px`;
130+
this._editorContainer.style.top = `${top}px`;
129131
const left = Math.round((windowWidth - width) / 2);
130-
domNode.style.left = `${left}px`;
132+
this._editorContainer.style.left = `${left}px`;
131133
}
132134

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

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
.monaco-editor .accessibilityHelpWidget {
7-
padding: 10px;
8-
vertical-align: middle;
9-
overflow: auto;
6+
.accessible-view {
7+
position: relative;
108
background-color: var(--vscode-editorWidget-background);
119
color: var(--vscode-editorWidget-foreground);
1210
box-shadow: 0 2px 8px var(--vscode-widget-shadow);
13-
border: 2px solid var(--vscode-contrastBorder);
11+
border: 2px solid var(--vscode-contrastActiveBorder);
1412
}

0 commit comments

Comments
 (0)