Archived
1
0

Set background color using VS Code theme

This commit is contained in:
Asher 2020-03-27 16:58:50 -05:00
parent 87ebf03eb7
commit 7954656610
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
2 changed files with 16 additions and 2 deletions

View File

@ -493,10 +493,10 @@ index eab8591492..26668701f7 100644
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
new file mode 100644
index 0000000000..4042e32f74
index 0000000000..96fbd4b0bb
--- /dev/null
+++ b/src/vs/server/browser/client.ts
@@ -0,0 +1,263 @@
@@ -0,0 +1,270 @@
+import { Emitter } from 'vs/base/common/event';
+import { URI } from 'vs/base/common/uri';
+import { localize } from 'vs/nls';
@ -515,6 +515,7 @@ index 0000000000..4042e32f74
+import { LocalizationsService } from 'vs/workbench/services/localizations/electron-browser/localizationsService';
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
+import { Options } from 'vs/server/ipc.d';
+import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
+
+class TelemetryService extends TelemetryChannelClient {
+ public constructor(
@ -725,6 +726,12 @@ index 0000000000..4042e32f74
+ };
+
+ updateLoop();
+
+ // This will be used to set the background color while VS Code loads.
+ const theme = (services.get(IStorageService) as IStorageService).get("colorThemeData", StorageScope.GLOBAL);
+ if (theme) {
+ localStorage.setItem("colorThemeData", theme);
+ }
+};
+
+export interface Query {

View File

@ -100,4 +100,11 @@
<script>
require(["vs/code/browser/workbench/workbench"], function() {})
</script>
<script>
try {
document.body.style.background = JSON.parse(localStorage.getItem("colorThemeData")).colorMap["editor.background"]
} catch (error) {
// Oh well.
}
</script>
</html>