Store parent popover in popover touch bar items

This commit is contained in:
Samuel Attard 2017-03-27 20:45:27 +11:00 committed by Kevin Sawicki
parent 8c8b737fa2
commit f05dfc74da
2 changed files with 10 additions and 1 deletions

View file

@ -126,7 +126,15 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
type:item_type];
if (!identifier) return;
NSTouchBarItem* item = [touchBar itemForIdentifier:identifier];
NSTouchBar* targetTouchBar = touchBar;
std::string popover_id;
if (settings.Get("_popover", &popover_id)) {
NSPopoverTouchBarItem* popoverItem = [touchBar itemForIdentifier:[self identifierFromID:popover_id type:"popover"]];
targetTouchBar = popoverItem.popoverTouchBar;
}
NSTouchBarItem* item = [targetTouchBar itemForIdentifier:identifier];
if (!item) return;
if (item_type == "button") {

View file

@ -223,6 +223,7 @@ TouchBar.TouchBarPopover = class TouchBarPopover extends TouchBarItem {
if (!(this.child instanceof TouchBar)) {
this.child = new TouchBar(this.child)
}
this.child.ordereredItems.forEach((item) => item._popover = this.id)
}
}