diff --git a/atom/browser/ui/cocoa/atom_touch_bar.mm b/atom/browser/ui/cocoa/atom_touch_bar.mm index 9aaa534e425f..9c3ac9eeeebc 100644 --- a/atom/browser/ui/cocoa/atom_touch_bar.mm +++ b/atom/browser/ui/cocoa/atom_touch_bar.mm @@ -333,10 +333,11 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide - (void)updatePopover:(NSPopoverTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings { std::string label; - gfx::Image image; if (settings.Get("label", &label)) { item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label); - } else if (settings.Get("image", &image)) { + } + gfx::Image image; + if (settings.Get("icon", &image)) { item.collapsedRepresentationImage = image.AsNSImage(); } diff --git a/lib/browser/api/touch-bar.js b/lib/browser/api/touch-bar.js index 83a8028b82e1..abcf8289e621 100644 --- a/lib/browser/api/touch-bar.js +++ b/lib/browser/api/touch-bar.js @@ -174,6 +174,7 @@ TouchBar.Popover = class TouchBarPopover extends TouchBarItem { super(config) this.type = 'popover' this._addLiveProperty('label', config.label) + this._addLiveProperty('icon', config.icon) this.showCloseButton = config.showCloseButton this.child = config.items if (!(this.child instanceof TouchBar)) {