* Change the current theme * @param {string} newTheme
(newTheme = null )
| 613 | * @param {string} newTheme |
| 614 | */ |
| 615 | changeTheme(newTheme = null ) { |
| 616 | if (newTheme !== null) { |
| 617 | this.#settings.set('color_theme', newTheme) |
| 618 | } |
| 619 | |
| 620 | const currentSetting = this.#settings.get('color_theme') |
| 621 | |
| 622 | if ( nativeTheme.themeSource !== currentSetting ) { |
| 623 | nativeTheme.themeSource = currentSetting |
| 624 | } |
| 625 | |
| 626 | this.#themeCurrentColor = ( currentSetting === 'system' ) ? |
| 627 | (nativeTheme.shouldUseDarkColors ? 'dark' : 'light') : |
| 628 | currentSetting |
| 629 | |
| 630 | if (newTheme !== null) { |
| 631 | this.populateContextIcons() |
| 632 | this.trayContextMenu() |
| 633 | this.themeUpdater() |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | /** |
| 638 | * update window theme |
no test coverage detected