mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Merge pull request #203357 from microsoft/merogge/status2
ensure alerts do not override content
This commit is contained in:
commit
09231caec0
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
import { alert, status } from 'vs/base/browser/ui/aria/aria';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
@ -110,4 +110,8 @@ export class AccessibilityService extends Disposable implements IAccessibilitySe
|
|||
alert(message: string): void {
|
||||
alert(message);
|
||||
}
|
||||
|
||||
status(message: string): void {
|
||||
status(message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ export interface IAccessibilityService {
|
|||
getAccessibilitySupport(): AccessibilitySupport;
|
||||
setAccessibilitySupport(accessibilitySupport: AccessibilitySupport): void;
|
||||
alert(message: string): void;
|
||||
status(message: string): void;
|
||||
}
|
||||
|
||||
export const enum AccessibilitySupport {
|
||||
|
|
|
@ -19,4 +19,5 @@ export class TestAccessibilityService implements IAccessibilityService {
|
|||
setAccessibilitySupport(accessibilitySupport: AccessibilitySupport): void { }
|
||||
getAccessibilitySupport(): AccessibilitySupport { return AccessibilitySupport.Unknown; }
|
||||
alert(message: string): void { }
|
||||
status(message: string): void { }
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ export class AudioCueService extends Disposable implements IAudioCueService {
|
|||
public async playAudioCue(cue: AudioCue, options: IAudioCueOptions = {}): Promise<void> {
|
||||
const alertMessage = cue.alertMessage;
|
||||
if (this.isAlertEnabled(cue, options.userGesture) && alertMessage) {
|
||||
this.accessibilityService.alert(alertMessage);
|
||||
this.accessibilityService.status(alertMessage);
|
||||
}
|
||||
|
||||
if (this.isCueEnabled(cue, options.userGesture)) {
|
||||
|
@ -75,7 +75,7 @@ export class AudioCueService extends Disposable implements IAudioCueService {
|
|||
const cueArray = cues.map(c => 'cue' in c ? c.cue : c);
|
||||
const alerts = cueArray.filter(cue => this.isAlertEnabled(cue)).map(c => c.alertMessage);
|
||||
if (alerts.length) {
|
||||
this.accessibilityService.alert(alerts.join(', '));
|
||||
this.accessibilityService.status(alerts.join(', '));
|
||||
}
|
||||
|
||||
// Some audio cues might reuse sounds. Don't play the same sound twice.
|
||||
|
|
Loading…
Reference in a new issue