mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 09:10:30 -04:00
Merge from vscode 10492ba146318412cbee8b76a8c630f226914734
This commit is contained in:
@@ -46,6 +46,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { InputBox, MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { MenuRegistry, MenuId, isIMenuItem } from 'vs/platform/actions/common/actions';
|
||||
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
|
||||
|
||||
const $ = DOM.$;
|
||||
|
||||
@@ -458,6 +459,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditorP
|
||||
ariaLabel: localize('keybindingsLabel', "Keybindings"),
|
||||
setRowLineHeight: false,
|
||||
horizontalScrolling: false,
|
||||
accessibilityProvider: new AccessibilityProvider(),
|
||||
overrideStyles: {
|
||||
listBackground: editorBackground
|
||||
}
|
||||
@@ -826,7 +828,6 @@ class KeybindingItemRenderer implements IListRenderer<IKeybindingItemEntry, Keyb
|
||||
|
||||
this.keybindingsEditor.layoutColumns(elements);
|
||||
this.keybindingsEditor.onLayout(() => this.keybindingsEditor.layoutColumns(elements));
|
||||
parent.setAttribute('aria-labelledby', elements.map(e => e.getAttribute('id')).join(' '));
|
||||
|
||||
return {
|
||||
parent,
|
||||
@@ -933,7 +934,6 @@ class CommandColumn extends Column {
|
||||
const commandIdMatched = !!(keybindingItem.commandLabel && keybindingItemEntry.commandIdMatches);
|
||||
const commandDefaultLabelMatched = !!keybindingItemEntry.commandDefaultLabelMatches;
|
||||
DOM.toggleClass(this.commandColumn, 'vertical-align-column', commandIdMatched || commandDefaultLabelMatched);
|
||||
this.commandColumn.setAttribute('aria-label', this.getAriaLabel(keybindingItemEntry));
|
||||
let commandLabel: HighlightedLabel | undefined;
|
||||
if (keybindingItem.commandLabel) {
|
||||
commandLabel = new HighlightedLabel(this.commandColumn, false);
|
||||
@@ -951,10 +951,6 @@ class CommandColumn extends Column {
|
||||
commandLabel.element.title = keybindingItem.commandLabel ? localize('title', "{0} ({1})", keybindingItem.commandLabel, keybindingItem.command) : keybindingItem.command;
|
||||
}
|
||||
}
|
||||
|
||||
private getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
|
||||
return keybindingItemEntry.keybindingItem.commandLabel ? keybindingItemEntry.keybindingItem.commandLabel : keybindingItemEntry.keybindingItem.command;
|
||||
}
|
||||
}
|
||||
|
||||
class KeybindingColumn extends Column {
|
||||
@@ -974,15 +970,10 @@ class KeybindingColumn extends Column {
|
||||
|
||||
render(keybindingItemEntry: IKeybindingItemEntry): void {
|
||||
DOM.clearNode(this.keybindingLabel);
|
||||
this.keybindingLabel.setAttribute('aria-label', this.getAriaLabel(keybindingItemEntry));
|
||||
if (keybindingItemEntry.keybindingItem.keybinding) {
|
||||
new KeybindingLabel(this.keybindingLabel, OS).set(keybindingItemEntry.keybindingItem.keybinding, keybindingItemEntry.keybindingMatches);
|
||||
}
|
||||
}
|
||||
|
||||
private getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
|
||||
return keybindingItemEntry.keybindingItem.keybinding ? localize('keybindingAriaLabel', "Keybinding is {0}.", keybindingItemEntry.keybindingItem.keybinding.getAriaLabel()) : localize('noKeybinding', "No Keybinding assigned.");
|
||||
}
|
||||
}
|
||||
|
||||
class SourceColumn extends Column {
|
||||
@@ -1000,13 +991,8 @@ class SourceColumn extends Column {
|
||||
|
||||
render(keybindingItemEntry: IKeybindingItemEntry): void {
|
||||
DOM.clearNode(this.sourceColumn);
|
||||
this.sourceColumn.setAttribute('aria-label', this.getAriaLabel(keybindingItemEntry));
|
||||
new HighlightedLabel(this.sourceColumn, false).set(keybindingItemEntry.keybindingItem.source, keybindingItemEntry.sourceMatches);
|
||||
}
|
||||
|
||||
private getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
|
||||
return localize('sourceAriaLabel', "Source is {0}.", keybindingItemEntry.keybindingItem.source);
|
||||
}
|
||||
}
|
||||
|
||||
class WhenColumn extends Column {
|
||||
@@ -1096,7 +1082,6 @@ class WhenColumn extends Column {
|
||||
}
|
||||
}, this, this.renderDisposables);
|
||||
this.whenInput.value = keybindingItemEntry.keybindingItem.when || '';
|
||||
this.whenLabel.setAttribute('aria-label', this.getAriaLabel(keybindingItemEntry));
|
||||
DOM.toggleClass(this.whenLabel, 'code', !!keybindingItemEntry.keybindingItem.when);
|
||||
DOM.toggleClass(this.whenLabel, 'empty', !keybindingItemEntry.keybindingItem.when);
|
||||
if (keybindingItemEntry.keybindingItem.when) {
|
||||
@@ -1117,10 +1102,18 @@ class WhenColumn extends Column {
|
||||
this.keybindingsEditor.selectKeybinding(keybindingItemEntry);
|
||||
}, this, this.renderDisposables);
|
||||
}
|
||||
}
|
||||
|
||||
private getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
|
||||
return keybindingItemEntry.keybindingItem.when ? localize('whenAriaLabel', "When is {0}.", keybindingItemEntry.keybindingItem.when) : localize('noWhen', "No when context.");
|
||||
class AccessibilityProvider implements IAccessibilityProvider<IKeybindingItemEntry> {
|
||||
|
||||
getAriaLabel(keybindingItemEntry: IKeybindingItemEntry): string {
|
||||
let ariaLabel = localize('commandAriaLabel', "Command is {0}.", keybindingItemEntry.keybindingItem.commandLabel ? keybindingItemEntry.keybindingItem.commandLabel : keybindingItemEntry.keybindingItem.command);
|
||||
ariaLabel += keybindingItemEntry.keybindingItem.keybinding ? localize('keybindingAriaLabel', "Keybinding is {0}.", keybindingItemEntry.keybindingItem.keybinding.getAriaLabel()) : localize('noKeybinding', "No Keybinding assigned.");
|
||||
ariaLabel += localize('sourceAriaLabel', "Source is {0}.", keybindingItemEntry.keybindingItem.source);
|
||||
ariaLabel += keybindingItemEntry.keybindingItem.when ? localize('whenAriaLabel', "When is {0}.", keybindingItemEntry.keybindingItem.when) : localize('noWhen', "No when context.");
|
||||
return ariaLabel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/preferences';
|
||||
import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import 'vs/css!../browser/media/preferences';
|
||||
import { Context as SuggestContext } from 'vs/editor/contrib/suggest/suggest';
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action2, MenuId, MenuRegistry, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||
|
||||
@@ -12,7 +12,7 @@ import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cance
|
||||
import { IStringDictionary } from 'vs/base/common/collections';
|
||||
import { getErrorMessage, isPromiseCanceledError, onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { ArrayNavigator } from 'vs/base/common/iterator';
|
||||
import { ArrayNavigator } from 'vs/base/common/navigator';
|
||||
import { Disposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Delayer, ThrottledDelayer, timeout, IntervalTimer } from 'vs/base/commo
|
||||
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||
import * as collections from 'vs/base/common/collections';
|
||||
import { getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { Iterator } from 'vs/base/common/iterator';
|
||||
import { Iterable } from 'vs/base/common/iterator';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
@@ -58,10 +58,8 @@ import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/p
|
||||
import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
|
||||
import { fromNow } from 'vs/base/common/date';
|
||||
|
||||
function createGroupIterator(group: SettingsTreeGroupElement): Iterator<ITreeElement<SettingsTreeGroupChild>> {
|
||||
const groupsIt = Iterator.fromArray(group.children);
|
||||
|
||||
return Iterator.map(groupsIt, g => {
|
||||
function createGroupIterator(group: SettingsTreeGroupElement): Iterable<ITreeElement<SettingsTreeGroupChild>> {
|
||||
return Iterable.map(group.children, g => {
|
||||
return {
|
||||
element: g,
|
||||
children: g instanceof SettingsTreeGroupElement ?
|
||||
|
||||
@@ -8,7 +8,7 @@ import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
|
||||
import { DefaultStyleController, IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { IObjectTreeOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree';
|
||||
import { ITreeElement, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree';
|
||||
import { Iterator } from 'vs/base/common/iterator';
|
||||
import { Iterable } from 'vs/base/common/iterator';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { editorBackground, transparent, foreground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { attachStyler } from 'vs/platform/theme/common/styler';
|
||||
@@ -138,11 +138,10 @@ class TOCTreeDelegate implements IListVirtualDelegate<SettingsTreeElement> {
|
||||
}
|
||||
}
|
||||
|
||||
export function createTOCIterator(model: TOCTreeModel | SettingsTreeGroupElement, tree: TOCTree): Iterator<ITreeElement<SettingsTreeGroupElement>> {
|
||||
export function createTOCIterator(model: TOCTreeModel | SettingsTreeGroupElement, tree: TOCTree): Iterable<ITreeElement<SettingsTreeGroupElement>> {
|
||||
const groupChildren = <SettingsTreeGroupElement[]>model.children.filter(c => c instanceof SettingsTreeGroupElement);
|
||||
const groupsIt = Iterator.fromArray(groupChildren);
|
||||
|
||||
return Iterator.map(groupsIt, g => {
|
||||
return Iterable.map(groupChildren, g => {
|
||||
const hasGroupChildren = g.children.some(c => c instanceof SettingsTreeGroupElement);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user