Support icon for button.component (#1565)

* support icon button

* formatting

* fix dropdown css and set attribute for model view editor
This commit is contained in:
Abbie Petchtes
2018-06-06 14:05:36 -07:00
committed by GitHub
parent cf6a7198f9
commit 38ad60478c
10 changed files with 122 additions and 15 deletions

View File

@@ -266,10 +266,23 @@ export default class MainController implements vscode.Disposable {
values: ['aa', 'bb', 'cc']
})
.component();
let button = view.modelBuilder.button()
let runIcon = path.join(__dirname, '..', 'media', 'start.svg');
let runButton = view.modelBuilder.button()
.withProperties({
label: 'Run'
label: 'Run',
iconPath: runIcon
}).component();
let monitoLightPath = vscode.Uri.file(path.join(__dirname, '..', 'media', 'monitor.svg'));
let monitorIcon = {
light: monitoLightPath,
dark: path.join(__dirname, '..', 'media', 'monitor_inverse.svg') };
let monitorButton = view.modelBuilder.button()
.withProperties({
label: 'Monitor',
iconPath: monitorIcon
}).component();
let toolbarModel = view.modelBuilder.toolbarContainer()
.withToolbarItems([{
component: inputBox,
@@ -278,7 +291,9 @@ export default class MainController implements vscode.Disposable {
component: dropdown,
title: 'favorite:'
}, {
component: button
component: runButton
}, {
component: monitorButton
}]).component();