MCPcopy
hub / github.com/pickle-com/glass / createFeatureWindow

Function createFeatureWindow

src/window/windowManager.js:370–549  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

368 };
369
370 const createFeatureWindow = (name) => {
371 if (windowPool.has(name)) return;
372
373 switch (name) {
374 case 'listen': {
375 const listen = new BrowserWindow({
376 ...commonChildOptions, width:400,minWidth:400,maxWidth:900,
377 maxHeight:900,
378 });
379 listen.setContentProtection(isContentProtectionOn);
380 listen.setVisibleOnAllWorkspaces(true,{visibleOnFullScreen:true});
381 if (process.platform === 'darwin') {
382 listen.setWindowButtonVisibility(false);
383 }
384 const listenLoadOptions = { query: { view: 'listen' } };
385 if (!shouldUseLiquidGlass) {
386 listen.loadFile(path.join(__dirname, '../ui/app/content.html'), listenLoadOptions);
387 }
388 else {
389 listenLoadOptions.query.glass = 'true';
390 listen.loadFile(path.join(__dirname, '../ui/app/content.html'), listenLoadOptions);
391 listen.webContents.once('did-finish-load', () => {
392 const viewId = liquidGlass.addView(listen.getNativeWindowHandle());
393 if (viewId !== -1) {
394 liquidGlass.unstable_setVariant(viewId, liquidGlass.GlassMaterialVariant.bubbles);
395 // liquidGlass.unstable_setScrim(viewId, 1);
396 // liquidGlass.unstable_setSubdued(viewId, 1);
397 }
398 });
399 }
400 if (!app.isPackaged) {
401 listen.webContents.openDevTools({ mode: 'detach' });
402 }
403 windowPool.set('listen', listen);
404 break;
405 }
406
407 // ask
408 case 'ask': {
409 const ask = new BrowserWindow({ ...commonChildOptions, width:600 });
410 ask.setContentProtection(isContentProtectionOn);
411 ask.setVisibleOnAllWorkspaces(true,{visibleOnFullScreen:true});
412 if (process.platform === 'darwin') {
413 ask.setWindowButtonVisibility(false);
414 }
415 const askLoadOptions = { query: { view: 'ask' } };
416 if (!shouldUseLiquidGlass) {
417 ask.loadFile(path.join(__dirname, '../ui/app/content.html'), askLoadOptions);
418 }
419 else {
420 askLoadOptions.query.glass = 'true';
421 ask.loadFile(path.join(__dirname, '../ui/app/content.html'), askLoadOptions);
422 ask.webContents.once('did-finish-load', () => {
423 const viewId = liquidGlass.addView(ask.getNativeWindowHandle());
424 if (viewId !== -1) {
425 liquidGlass.unstable_setVariant(viewId, liquidGlass.GlassMaterialVariant.bubbles);
426 // liquidGlass.unstable_setScrim(viewId, 1);
427 // liquidGlass.unstable_setSubdued(viewId, 1);

Callers 1

createFeatureWindowsFunction · 0.85

Calls 8

disableClicksFunction · 0.85
restoreClicksFunction · 0.85
showMethod · 0.80
onMethod · 0.80
registerShortcutsMethod · 0.80
loadKeybindsMethod · 0.80
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected