MCPcopy Create free account
hub / github.com/chieapp/chie / constructor

Method constructor

src/view/base-window.ts:27–62  ·  view source on GitHub ↗
(options: BaseWindowOptions = {})

Source from the content-addressed store, hash-verified

25 isClosed = false;
26
27 constructor(options: BaseWindowOptions = {}) {
28 super();
29
30 this.window = gui.Window.create(options);
31 if (process.platform == 'win32')
32 this.window.setBackgroundColor('#F5F5F5');
33 if (process.platform != 'darwin') {
34 this.menuBar = new WindowMenuBar(this, options.viewClass);
35 this.window.setMenuBar(this.menuBar.menu);
36 if (!options.showMenuBar)
37 this.window.setMenuBarVisible(false);
38 }
39
40 if (options.pressEscToClose) {
41 this.window.onKeyUp = (window, event) => {
42 if (event.key == 'Escape')
43 this.window.close();
44 };
45 }
46
47 if (!options.useClassicBackground && process.platform == 'darwin') {
48 const vibrant = gui.Vibrant.create();
49 vibrant.setMaterial('window-background');
50 this.contentView = vibrant;
51 } else {
52 this.contentView = gui.Container.create();
53 }
54 this.window.setContentView(this.contentView);
55
56 windowManager.addWindow(this);
57 this.window.onClose = () => {
58 this.isClosed = true;
59 this.destructor();
60 windowManager.removeWindow(this);
61 };
62 }
63
64 destructor() {
65 super.destructor();

Callers

nothing calls this directly

Calls 5

destructorMethod · 0.95
setBackgroundColorMethod · 0.80
closeMethod · 0.80
addWindowMethod · 0.80
removeWindowMethod · 0.80

Tested by

no test coverage detected