Add live popover icon property
This commit is contained in:
parent
a34f9d3583
commit
ce12dcd3b4
2 changed files with 4 additions and 2 deletions
|
@ -333,10 +333,11 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide
|
||||||
- (void)updatePopover:(NSPopoverTouchBarItem*)item
|
- (void)updatePopover:(NSPopoverTouchBarItem*)item
|
||||||
withSettings:(const mate::PersistentDictionary&)settings {
|
withSettings:(const mate::PersistentDictionary&)settings {
|
||||||
std::string label;
|
std::string label;
|
||||||
gfx::Image image;
|
|
||||||
if (settings.Get("label", &label)) {
|
if (settings.Get("label", &label)) {
|
||||||
item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label);
|
item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label);
|
||||||
} else if (settings.Get("image", &image)) {
|
}
|
||||||
|
gfx::Image image;
|
||||||
|
if (settings.Get("icon", &image)) {
|
||||||
item.collapsedRepresentationImage = image.AsNSImage();
|
item.collapsedRepresentationImage = image.AsNSImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,6 +174,7 @@ TouchBar.Popover = class TouchBarPopover extends TouchBarItem {
|
||||||
super(config)
|
super(config)
|
||||||
this.type = 'popover'
|
this.type = 'popover'
|
||||||
this._addLiveProperty('label', config.label)
|
this._addLiveProperty('label', config.label)
|
||||||
|
this._addLiveProperty('icon', config.icon)
|
||||||
this.showCloseButton = config.showCloseButton
|
this.showCloseButton = config.showCloseButton
|
||||||
this.child = config.items
|
this.child = config.items
|
||||||
if (!(this.child instanceof TouchBar)) {
|
if (!(this.child instanceof TouchBar)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue