mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Support icon property to match MenuItem
This commit is contained in:
@@ -227,7 +227,7 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||
}
|
||||
|
||||
gfx::Image image;
|
||||
if (settings.Get("image", &image)) {
|
||||
if (settings.Get("icon", &image)) {
|
||||
button.image = image.AsNSImage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,9 +115,10 @@ TouchBar.Button = class TouchBarButton extends TouchBarItem {
|
||||
constructor (config) {
|
||||
super(config)
|
||||
this.type = 'button'
|
||||
const {click, label, backgroundColor} = config
|
||||
const {click, icon, label, backgroundColor} = config
|
||||
this._addLiveProperty('label', label)
|
||||
this._addLiveProperty('backgroundColor', backgroundColor)
|
||||
this._addLiveProperty('icon', icon)
|
||||
if (typeof click === 'function') {
|
||||
this.onInteraction = config.click
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user