MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / changeTheme

Method changeTheme

lib/modAssist_window_lib.js:615–635  ·  view source on GitHub ↗

* Change the current theme * @param {string} newTheme

(newTheme = null )

Source from the content-addressed store, hash-verified

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

Callers 4

modAssist_main.jsFile · 0.80
constructorMethod · 0.80
loadSettingsMethod · 0.80
themeCurrentColorMethod · 0.80

Calls 5

setMethod · 0.80
populateContextIconsMethod · 0.80
trayContextMenuMethod · 0.80
themeUpdaterMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected