MCPcopy
hub / github.com/microsoft/SandDance / checkForDarkTheme

Method checkForDarkTheme

extensions/common-frontend/src/app.tsx:117–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 }
116
117 checkForDarkTheme() {
118 const vscodeThemeClassName = getVscodeThemeClassName();
119 const darkTheme = vscodeThemeClassName.indexOf('dark') >= 0;
120 this.viewerOptions = getViewerOptions(darkTheme);
121 if (this.state.darkTheme !== darkTheme && this.explorer) {
122 this.explorer.updateViewerOptions(this.viewerOptions);
123 if (this.explorer.viewer) {
124 this.explorer.viewer.renderSameLayout(this.explorer.viewerOptions);
125 }
126 }
127 FluentUIReact.loadTheme({ palette: getThemePalette(darkTheme) });
128 this.setState({ darkTheme });
129 }
130
131 mounted(explorer: SandDanceExplorer.Explorer_Class) {
132 this.explorer = explorer;

Callers 1

mountedMethod · 0.95

Calls 5

getVscodeThemeClassNameFunction · 0.85
getViewerOptionsFunction · 0.70
getThemePaletteFunction · 0.70
updateViewerOptionsMethod · 0.45
renderSameLayoutMethod · 0.45

Tested by

no test coverage detected