MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getWebGlIconButton

Method getWebGlIconButton

frontend/app/view/term/term-model.ts:452–482  ·  view source on GitHub ↗
(get: jotai.Getter)

Source from the content-addressed store, hash-verified

450 }
451
452 getWebGlIconButton(get: jotai.Getter): IconButtonDecl | null {
453 if (!WebGLSupported) {
454 return {
455 elemtype: "iconbutton",
456 icon: "microchip",
457 iconColor: "var(--error-color)",
458 title: "WebGL not supported",
459 noAction: true,
460 };
461 }
462 if (!this.termRef.current?.webglEnabledAtom) {
463 return null;
464 }
465 const webglEnabled = get(this.termRef.current.webglEnabledAtom);
466 if (webglEnabled) {
467 return {
468 elemtype: "iconbutton",
469 icon: "microchip",
470 iconColor: "var(--success-color)",
471 title: "WebGL enabled (click to disable)",
472 click: () => this.toggleWebGl(),
473 };
474 }
475 return {
476 elemtype: "iconbutton",
477 icon: "microchip",
478 iconColor: "var(--secondary-text-color)",
479 title: "WebGL disabled (click to enable)",
480 click: () => this.toggleWebGl(),
481 };
482 }
483
484 get viewComponent(): ViewComponent {
485 return TerminalView as ViewComponent;

Callers 1

constructorMethod · 0.95

Calls 1

toggleWebGlMethod · 0.95

Tested by

no test coverage detected