mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Merge from vscode 52dcb723a39ae75bee1bd56b3312d7fcdc87aeed (#6719)
This commit is contained in:
@@ -8,7 +8,7 @@ import 'vs/css!./selectBox';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { deepClone, mixin } from 'vs/base/common/objects';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { SelectBoxNative } from 'vs/base/browser/ui/selectBox/selectBoxNative';
|
||||
@@ -77,14 +77,11 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
|
||||
protected selectBackground?: Color;
|
||||
protected selectForeground?: Color;
|
||||
protected selectBorder?: Color;
|
||||
private styles: ISelectBoxStyles;
|
||||
private selectBoxDelegate: ISelectBoxDelegate;
|
||||
|
||||
constructor(options: ISelectOptionItem[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles = deepClone(defaultStyles), selectBoxOptions?: ISelectBoxOptions) {
|
||||
super();
|
||||
|
||||
mixin(this.styles, defaultStyles, false);
|
||||
|
||||
// Default to native SelectBox for OSX unless overridden
|
||||
if (isMacintosh && !(selectBoxOptions && selectBoxOptions.useCustomDrawn)) {
|
||||
this.selectBoxDelegate = new SelectBoxNative(options, selected, styles, selectBoxOptions);
|
||||
|
||||
@@ -93,23 +93,24 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
|
||||
private _isVisible: boolean;
|
||||
private selectBoxOptions: ISelectBoxOptions;
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
public selectElement: HTMLSelectElement;
|
||||
private options: ISelectOptionItem[];
|
||||
private options: ISelectOptionItem[] = [];
|
||||
private selected: number;
|
||||
private readonly _onDidSelect: Emitter<ISelectData>;
|
||||
private styles: ISelectBoxStyles;
|
||||
private listRenderer: SelectListRenderer;
|
||||
private contextViewProvider: IContextViewProvider;
|
||||
private selectDropDownContainer: HTMLElement;
|
||||
private styleElement: HTMLStyleElement;
|
||||
private selectList: List<ISelectOptionItem>;
|
||||
private selectDropDownListContainer: HTMLElement;
|
||||
private widthControlElement: HTMLElement;
|
||||
private _currentSelection: number;
|
||||
private _dropDownPosition: AnchorPosition;
|
||||
private listRenderer!: SelectListRenderer;
|
||||
private contextViewProvider!: IContextViewProvider;
|
||||
private selectDropDownContainer!: HTMLElement;
|
||||
private styleElement!: HTMLStyleElement;
|
||||
private selectList!: List<ISelectOptionItem>;
|
||||
private selectDropDownListContainer!: HTMLElement;
|
||||
private widthControlElement!: HTMLElement;
|
||||
private _currentSelection = 0;
|
||||
private _dropDownPosition!: AnchorPosition;
|
||||
private _hasDetails: boolean = false;
|
||||
private selectionDetailsPane: HTMLElement;
|
||||
private selectionDetailsPane!: HTMLElement;
|
||||
private _skipLayout: boolean = false;
|
||||
|
||||
private _sticky: boolean = false; // for dev purposes only
|
||||
@@ -247,7 +248,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
}
|
||||
|
||||
public setOptions(options: ISelectOptionItem[], selected?: number): void {
|
||||
if (!this.options || !arrays.equals(this.options, options)) {
|
||||
if (!arrays.equals(this.options, options)) {
|
||||
this.options = options;
|
||||
this.selectElement.options.length = 0;
|
||||
this._hasDetails = false;
|
||||
@@ -272,7 +273,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
|
||||
// Mirror options in drop-down
|
||||
// Populate select list for non-native select mode
|
||||
if (this.selectList && !!this.options) {
|
||||
if (this.selectList) {
|
||||
this.selectList.splice(0, this.selectList.length, this.options);
|
||||
}
|
||||
}
|
||||
@@ -704,7 +705,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
||||
private setWidthControlElement(container: HTMLElement): number {
|
||||
let elementWidth = 0;
|
||||
|
||||
if (container && !!this.options) {
|
||||
if (container) {
|
||||
let longest = 0;
|
||||
let longestLength = 0;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ export class SelectBoxNative extends Disposable implements ISelectBoxDelegate {
|
||||
public selectElement: HTMLSelectElement;
|
||||
private selectBoxOptions: ISelectBoxOptions;
|
||||
private options: ISelectOptionItem[];
|
||||
private selected: number;
|
||||
private selected = 0;
|
||||
private readonly _onDidSelect: Emitter<ISelectData>;
|
||||
private styles: ISelectBoxStyles;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user