mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-23 05:10:30 -04:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -25,7 +25,7 @@ export namespace PeekContext {
|
||||
export const notInPeekEditor: ContextKeyExpr = inPeekEditor.toNegated();
|
||||
}
|
||||
|
||||
export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor {
|
||||
export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null {
|
||||
let editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
|
||||
if (editor instanceof EmbeddedCodeEditorWidget) {
|
||||
return editor.getParentEditor();
|
||||
@@ -34,13 +34,12 @@ export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor {
|
||||
}
|
||||
|
||||
export interface IPeekViewStyles extends IStyles {
|
||||
headerBackgroundColor?: Color;
|
||||
primaryHeadingColor?: Color;
|
||||
secondaryHeadingColor?: Color;
|
||||
headerBackgroundColor?: Color | null;
|
||||
primaryHeadingColor?: Color | null;
|
||||
secondaryHeadingColor?: Color | null;
|
||||
}
|
||||
|
||||
export interface IPeekViewOptions extends IOptions, IPeekViewStyles {
|
||||
}
|
||||
export type IPeekViewOptions = IOptions & IPeekViewStyles;
|
||||
|
||||
const defaultOptions: IPeekViewOptions = {
|
||||
headerBackgroundColor: Color.white,
|
||||
@@ -92,16 +91,16 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
protected _applyStyles(): void {
|
||||
super._applyStyles();
|
||||
let options = <IPeekViewOptions>this.options;
|
||||
if (this._headElement) {
|
||||
if (this._headElement && options.headerBackgroundColor) {
|
||||
this._headElement.style.backgroundColor = options.headerBackgroundColor.toString();
|
||||
}
|
||||
if (this._primaryHeading) {
|
||||
if (this._primaryHeading && options.primaryHeadingColor) {
|
||||
this._primaryHeading.style.color = options.primaryHeadingColor.toString();
|
||||
}
|
||||
if (this._secondaryHeading) {
|
||||
if (this._secondaryHeading && options.secondaryHeadingColor) {
|
||||
this._secondaryHeading.style.color = options.secondaryHeadingColor.toString();
|
||||
}
|
||||
if (this._bodyElement) {
|
||||
if (this._bodyElement && options.frameColor) {
|
||||
this._bodyElement.style.borderColor = options.frameColor.toString();
|
||||
}
|
||||
}
|
||||
@@ -138,7 +137,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
|
||||
this._actionbarWidget.push(new Action('peekview.close', nls.localize('label.close', "Close"), 'close-peekview-action', true, () => {
|
||||
this.dispose();
|
||||
return null;
|
||||
return Promise.resolve();
|
||||
}), { label: false, icon: true });
|
||||
}
|
||||
|
||||
@@ -186,11 +185,11 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
}
|
||||
|
||||
protected _doLayoutHead(heightInPixel: number, widthInPixel: number): void {
|
||||
this._headElement.style.height = strings.format('{0}px', heightInPixel);
|
||||
this._headElement.style.height = `${heightInPixel}px`;
|
||||
this._headElement.style.lineHeight = this._headElement.style.height;
|
||||
}
|
||||
|
||||
protected _doLayoutBody(heightInPixel: number, widthInPixel: number): void {
|
||||
this._bodyElement.style.height = strings.format('{0}px', heightInPixel);
|
||||
this._bodyElement.style.height = `${heightInPixel}px`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user