initial work on updating touch bar item config without rerender
This commit is contained in:
parent
61949657f0
commit
dd09c91cf2
10 changed files with 98 additions and 27 deletions
|
@ -44,6 +44,16 @@ class TouchBarItem {
|
|||
}
|
||||
}
|
||||
|
||||
updateConfig(newConfig) {
|
||||
if (!this._owner) {
|
||||
throw new Error('Cannot call methods on TouchBarItems without assigning to a BrowserWindow');
|
||||
}
|
||||
const dupConfig = Object.assign({}, newConfig);
|
||||
delete dupConfig.id;
|
||||
Object.assign(this.config, dupConfig);
|
||||
this._owner._updateTouchBarItem(this.toJSON());
|
||||
}
|
||||
|
||||
toJSON () {
|
||||
return this.config
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue