mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 09:35:39 -05:00
Merge from master
This commit is contained in:
@@ -14,6 +14,7 @@ import { IListStyles } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { SelectBoxNative } from 'vs/base/browser/ui/selectBox/selectBoxNative';
|
||||
import { SelectBoxList } from 'vs/base/browser/ui/selectBox/selectBoxCustom';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { IContentActionHandler } from 'vs/base/browser/htmlContentRenderer';
|
||||
|
||||
// Public SelectBox interface - Calls routed to appropriate select implementation class
|
||||
|
||||
@@ -24,6 +25,7 @@ export interface ISelectBoxDelegate {
|
||||
setOptions(options: string[], selected?: number, disabled?: number): void;
|
||||
select(index: number): void;
|
||||
setAriaLabel(label: string);
|
||||
setDetailsProvider(provider: (index: number) => { details: string, isMarkdown: boolean });
|
||||
focus(): void;
|
||||
blur(): void;
|
||||
dispose(): void;
|
||||
@@ -37,6 +39,8 @@ export interface ISelectBoxDelegate {
|
||||
export interface ISelectBoxOptions {
|
||||
ariaLabel?: string;
|
||||
minBottomMargin?: number;
|
||||
hasDetails?: boolean;
|
||||
markdownActionHandler?: IContentActionHandler;
|
||||
}
|
||||
|
||||
export interface ISelectBoxStyles extends IListStyles {
|
||||
@@ -44,6 +48,7 @@ export interface ISelectBoxStyles extends IListStyles {
|
||||
selectListBackground?: Color;
|
||||
selectForeground?: Color;
|
||||
selectBorder?: Color;
|
||||
selectListBorder?: Color;
|
||||
focusBorder?: Color;
|
||||
}
|
||||
|
||||
@@ -73,8 +78,7 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
|
||||
mixin(this.styles, defaultStyles, false);
|
||||
|
||||
// Instantiate select implementation based on platform
|
||||
if (isMacintosh) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
if (isMacintosh && !(selectBoxOptions && selectBoxOptions.hasDetails)) {
|
||||
this.selectBoxDelegate = new SelectBoxNative(options, selected, styles, selectBoxOptions);
|
||||
} else {
|
||||
this.selectBoxDelegate = new SelectBoxList(options, selected, contextViewProvider, styles, selectBoxOptions);
|
||||
@@ -104,6 +108,10 @@ export class SelectBox extends Widget implements ISelectBoxDelegate {
|
||||
this.selectBoxDelegate.setAriaLabel(label);
|
||||
}
|
||||
|
||||
public setDetailsProvider(provider: (index: number) => { details: string, isMarkdown: boolean }): void {
|
||||
this.selectBoxDelegate.setDetailsProvider(provider);
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
this.selectBoxDelegate.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user