Support icon property to match MenuItem

This commit is contained in:
Kevin Sawicki 2017-03-02 12:56:23 -08:00
parent 506b42b563
commit a34f9d3583
2 changed files with 3 additions and 2 deletions

View file

@ -227,7 +227,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
} }
gfx::Image image; gfx::Image image;
if (settings.Get("image", &image)) { if (settings.Get("icon", &image)) {
button.image = image.AsNSImage(); button.image = image.AsNSImage();
} }
} }

View file

@ -115,9 +115,10 @@ TouchBar.Button = class TouchBarButton extends TouchBarItem {
constructor (config) { constructor (config) {
super(config) super(config)
this.type = 'button' this.type = 'button'
const {click, label, backgroundColor} = config const {click, icon, label, backgroundColor} = config
this._addLiveProperty('label', label) this._addLiveProperty('label', label)
this._addLiveProperty('backgroundColor', backgroundColor) this._addLiveProperty('backgroundColor', backgroundColor)
this._addLiveProperty('icon', icon)
if (typeof click === 'function') { if (typeof click === 'function') {
this.onInteraction = config.click this.onInteraction = config.click
} }