Add live popover icon property

This commit is contained in:
Kevin Sawicki 2017-03-02 13:37:34 -08:00
parent a34f9d3583
commit ce12dcd3b4
2 changed files with 4 additions and 2 deletions

View file

@ -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();
}

View file

@ -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)) {