"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/browser/api/touch-bar.ts" between
electron-11.4.1.tar.gz and electron-11.4.2.tar.gz

About: Electron is a framework for creating native cross platform applications with web technologies like JavaScript, HTML, and CSS.

touch-bar.ts  (electron-11.4.1):touch-bar.ts  (electron-11.4.2)
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
let nextItemID = 1; let nextItemID = 1;
const hiddenProperties = Symbol('hidden touch bar props'); const hiddenProperties = Symbol('hidden touch bar props');
const extendConstructHook = (target: any, hook: Function) => { const extendConstructHook = (target: any, hook: Function) => {
const existingHook = target._hook; const existingHook = target._hook;
target._hook = function () { target._hook = function () {
hook.call(this);
if (existingHook) existingHook.call(this); if (existingHook) existingHook.call(this);
hook.call(this);
}; };
}; };
const ImmutableProperty = <T extends TouchBarItem<any>>(def: (config: T extends TouchBarItem<infer C> ? C : never, setInternalProp: <K extends keyof T>(k: K, v: T[K]) => void) => any) => (target: T, propertyKey: keyof T) => { const ImmutableProperty = <T extends TouchBarItem<any>>(def: (config: T extends TouchBarItem<infer C> ? C : never, setInternalProp: <K extends keyof T>(k: K, v: T[K]) => void) => any) => (target: T, propertyKey: keyof T) => {
extendConstructHook(target as any, function (this: T) { extendConstructHook(target as any, function (this: T) {
(this as any)[hiddenProperties][propertyKey] = def((this as any)._config, (k , v) => { (this as any)[hiddenProperties][propertyKey] = def((this as any)._config, (k , v) => {
(this as any)[hiddenProperties][k] = v; (this as any)[hiddenProperties][k] = v;
}); });
}); });
Object.defineProperty(target, propertyKey, { Object.defineProperty(target, propertyKey, {
skipping to change at line 138 skipping to change at line 138
@ImmutableProperty(() => 'group') @ImmutableProperty(() => 'group')
type!: string; type!: string;
@LiveProperty<TouchBarGroup>(config => config.items instanceof TouchBar ? conf ig.items : new TouchBar(config.items), (self, newChild: TouchBar) => { @LiveProperty<TouchBarGroup>(config => config.items instanceof TouchBar ? conf ig.items : new TouchBar(config.items), (self, newChild: TouchBar) => {
if (self.child) { if (self.child) {
for (const item of self.child.orderedItems) { for (const item of self.child.orderedItems) {
item._removeParent(self); item._removeParent(self);
} }
} }
for (const item of newChild.orderedItems) { for (const item of newChild.orderedItems) {
item._addParent(item); item._addParent(self);
} }
}) })
child!: TouchBar; child!: TouchBar;
onInteraction = null; onInteraction = null;
} }
class TouchBarLabel extends TouchBarItem<Electron.TouchBarLabelConstructorOption s> implements Electron.TouchBarLabel { class TouchBarLabel extends TouchBarItem<Electron.TouchBarLabelConstructorOption s> implements Electron.TouchBarLabel {
@ImmutableProperty(() => 'label') @ImmutableProperty(() => 'label')
type!: string; type!: string;
skipping to change at line 182 skipping to change at line 182
@LiveProperty<TouchBarPopover>(config => config.showCloseButton) @LiveProperty<TouchBarPopover>(config => config.showCloseButton)
showCloseButton!: boolean; showCloseButton!: boolean;
@LiveProperty<TouchBarPopover>(config => config.items instanceof TouchBar ? co nfig.items : new TouchBar(config.items), (self, newChild: TouchBar) => { @LiveProperty<TouchBarPopover>(config => config.items instanceof TouchBar ? co nfig.items : new TouchBar(config.items), (self, newChild: TouchBar) => {
if (self.child) { if (self.child) {
for (const item of self.child.orderedItems) { for (const item of self.child.orderedItems) {
item._removeParent(self); item._removeParent(self);
} }
} }
for (const item of newChild.orderedItems) { for (const item of newChild.orderedItems) {
item._addParent(item); item._addParent(self);
} }
}) })
child!: TouchBar; child!: TouchBar;
onInteraction = null; onInteraction = null;
} }
class TouchBarSlider extends TouchBarItem<Electron.TouchBarSliderConstructorOpti ons> implements Electron.TouchBarSlider { class TouchBarSlider extends TouchBarItem<Electron.TouchBarSliderConstructorOpti ons> implements Electron.TouchBarSlider {
@ImmutableProperty(() => 'slider') @ImmutableProperty(() => 'slider')
type!: string; type!: string;
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)