(get: jotai.Getter)
| 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; |
no test coverage detected