Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -12,7 +12,7 @@ import { alert as ariaAlert } from 'vs/base/browser/ui/aria/aria';
import { Button } from 'vs/base/browser/ui/button/button';
import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox';
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
import { IListVirtualDelegate, ListAriaRootRole } from 'vs/base/browser/ui/list/list';
import { ListAriaRootRole, CachedListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { DefaultStyleController } from 'vs/base/browser/ui/list/listWidget';
import { ISelectOptionItem, SelectBox } from 'vs/base/browser/ui/selectBox/selectBox';
import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
@@ -1379,29 +1379,7 @@ export class SettingsTreeFilter implements ITreeFilter<SettingsTreeElement> {
}
}
class SettingsTreeDelegate implements IListVirtualDelegate<SettingsTreeGroupChild> {
private heightCache = new WeakMap<SettingsTreeGroupChild, number>();
getHeight(element: SettingsTreeGroupChild): number {
const cachedHeight = this.heightCache.get(element);
if (typeof cachedHeight === 'number') {
return cachedHeight;
}
if (element instanceof SettingsTreeGroupElement) {
if (element.isFirstGroup) {
return 31;
}
return 40 + (7 * element.level);
}
return element instanceof SettingsTreeSettingElement && element.valueType === SettingValueType.Boolean ?
78 :
104;
}
class SettingsTreeDelegate extends CachedListVirtualDelegate<SettingsTreeGroupChild> {
getTemplateId(element: SettingsTreeGroupElement | SettingsTreeSettingElement | SettingsTreeNewExtensionsElement): string {
if (element instanceof SettingsTreeGroupElement) {
@@ -1447,8 +1425,16 @@ class SettingsTreeDelegate implements IListVirtualDelegate<SettingsTreeGroupChil
return !(element instanceof SettingsTreeGroupElement);
}
setDynamicHeight(element: SettingsTreeGroupChild, height: number): void {
this.heightCache.set(element, height);
protected estimateHeight(element: SettingsTreeGroupChild): number {
if (element instanceof SettingsTreeGroupElement) {
if (element.isFirstGroup) {
return 31;
}
return 40 + (7 * element.level);
}
return element instanceof SettingsTreeSettingElement && element.valueType === SettingValueType.Boolean ? 78 : 104;
}
}
@@ -1488,8 +1474,8 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
filter: instantiationService.createInstance(SettingsTreeFilter, viewState)
});
this.disposables = [];
this.disposables.push(registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
this.disposables.clear();
this.disposables.add(registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
const activeBorderColor = theme.getColor(focusBorder);
if (activeBorderColor) {
// TODO@rob - why isn't this applied when added to the stylesheet from tocTree.ts? Seems like a chromium glitch.
@@ -1539,7 +1525,7 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
this.getHTMLElement().classList.add(treeClass);
this.disposables.push(attachStyler(themeService, {
this.disposables.add(attachStyler(themeService, {
listActiveSelectionBackground: transparent(Color.white, 0),
listActiveSelectionForeground: foreground,
listFocusAndSelectionBackground: transparent(Color.white, 0),