mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
address comments on support button icon (#1568)
* support icon button * formatting * fix dropdown css and set attribute for model view editor * address comments * fixing conflict
This commit is contained in:
@@ -273,9 +273,9 @@ export default class MainController implements vscode.Disposable {
|
|||||||
iconPath: runIcon
|
iconPath: runIcon
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
let monitoLightPath = vscode.Uri.file(path.join(__dirname, '..', 'media', 'monitor.svg'));
|
let monitorLightPath = vscode.Uri.file(path.join(__dirname, '..', 'media', 'monitor.svg'));
|
||||||
let monitorIcon = {
|
let monitorIcon = {
|
||||||
light: monitoLightPath,
|
light: monitorLightPath,
|
||||||
dark: path.join(__dirname, '..', 'media', 'monitor_inverse.svg') };
|
dark: path.join(__dirname, '..', 'media', 'monitor_inverse.svg') };
|
||||||
|
|
||||||
let monitorButton = view.modelBuilder.button()
|
let monitorButton = view.modelBuilder.button()
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ import { IdGenerator } from 'vs/base/common/idGenerator';
|
|||||||
import { createCSSRule, removeCSSRulesContainingSelector } from 'vs/base/browser/dom';
|
import { createCSSRule, removeCSSRulesContainingSelector } from 'vs/base/browser/dom';
|
||||||
import { focusBorder, foreground } from 'vs/platform/theme/common/colorRegistry';
|
import { focusBorder, foreground } from 'vs/platform/theme/common/colorRegistry';
|
||||||
import { Color } from 'vs/base/common/color';
|
import { Color } from 'vs/base/common/color';
|
||||||
|
|
||||||
|
type IUserFriendlyIcon = string | URI | { light: string | URI; dark: string | URI };
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'modelview-button',
|
selector: 'modelview-button',
|
||||||
template: `
|
template: `
|
||||||
@@ -34,7 +37,7 @@ export default class ButtonComponent extends ComponentBase implements IComponent
|
|||||||
@Input() modelStore: IModelStore;
|
@Input() modelStore: IModelStore;
|
||||||
private _button: Button;
|
private _button: Button;
|
||||||
private _iconClass: string;
|
private _iconClass: string;
|
||||||
private _iconPath: string | URI | { light: string | URI; dark: string | URI };
|
private _iconPath: IUserFriendlyIcon;
|
||||||
|
|
||||||
@ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef;
|
@ViewChild('input', { read: ElementRef }) private _inputContainer: ElementRef;
|
||||||
constructor(
|
constructor(
|
||||||
@@ -119,7 +122,7 @@ export default class ButtonComponent extends ComponentBase implements IComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getLightIconPath(iconPath: string | URI | { light: string | URI; dark: string | URI }): string {
|
private getLightIconPath(iconPath: IUserFriendlyIcon): string {
|
||||||
if (iconPath && iconPath['light']) {
|
if (iconPath && iconPath['light']) {
|
||||||
return this.getIconPath(iconPath['light']);
|
return this.getIconPath(iconPath['light']);
|
||||||
} else {
|
} else {
|
||||||
@@ -127,7 +130,7 @@ export default class ButtonComponent extends ComponentBase implements IComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDarkIconPath(iconPath: string | URI | { light: string | URI; dark: string | URI }): string {
|
private getDarkIconPath(iconPath: IUserFriendlyIcon): string {
|
||||||
if (iconPath && iconPath['dark']) {
|
if (iconPath && iconPath['dark']) {
|
||||||
return this.getIconPath(iconPath['dark']);
|
return this.getIconPath(iconPath['dark']);
|
||||||
}
|
}
|
||||||
@@ -154,11 +157,11 @@ export default class ButtonComponent extends ComponentBase implements IComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get iconPath(): string | URI | { light: string | URI; dark: string | URI } {
|
public get iconPath(): string | URI | { light: string | URI; dark: string | URI } {
|
||||||
return this.getPropertyOrDefault<sqlops.ButtonProperties, string | URI | { light: string | URI; dark: string | URI }>((props) => props.iconPath, undefined);
|
return this.getPropertyOrDefault<sqlops.ButtonProperties, IUserFriendlyIcon>((props) => props.iconPath, undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
public set iconPath(newValue: string | URI | { light: string | URI; dark: string | URI }) {
|
public set iconPath(newValue: string | URI | { light: string | URI; dark: string | URI }) {
|
||||||
this.setPropertyFromUI<sqlops.ButtonProperties, string | URI | { light: string | URI; dark: string | URI }>((properties, iconPath) => { properties.iconPath = iconPath; }, newValue);
|
this.setPropertyFromUI<sqlops.ButtonProperties, IUserFriendlyIcon>((properties, iconPath) => { properties.iconPath = iconPath; }, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private setValueProperties(properties: sqlops.ButtonProperties, label: string): void {
|
private setValueProperties(properties: sqlops.ButtonProperties, label: string): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user