From a34f9d35836bd4852ae8efee9269616b9c14c9d0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 2 Mar 2017 12:56:23 -0800 Subject: [PATCH] Support icon property to match MenuItem --- atom/browser/ui/cocoa/atom_touch_bar.mm | 2 +- lib/browser/api/touch-bar.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/atom/browser/ui/cocoa/atom_touch_bar.mm b/atom/browser/ui/cocoa/atom_touch_bar.mm index c16135c9adcd..9aaa534e425f 100644 --- a/atom/browser/ui/cocoa/atom_touch_bar.mm +++ b/atom/browser/ui/cocoa/atom_touch_bar.mm @@ -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(); } } diff --git a/lib/browser/api/touch-bar.js b/lib/browser/api/touch-bar.js index e5be1f3b49c3..83a8028b82e1 100644 --- a/lib/browser/api/touch-bar.js +++ b/lib/browser/api/touch-bar.js @@ -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 }