Skip to content

Commit 7954656

Browse files
committed
Set background color using VS Code theme
1 parent 87ebf03 commit 7954656

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

ci/vscode.patch

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,10 @@ index eab8591492..26668701f7 100644
493493
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
494494
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
495495
new file mode 100644
496-
index 0000000000..4042e32f74
496+
index 0000000000..96fbd4b0bb
497497
--- /dev/null
498498
+++ b/src/vs/server/browser/client.ts
499-
@@ -0,0 +1,263 @@
499+
@@ -0,0 +1,270 @@
500500
+import { Emitter } from 'vs/base/common/event';
501501
+import { URI } from 'vs/base/common/uri';
502502
+import { localize } from 'vs/nls';
@@ -515,6 +515,7 @@ index 0000000000..4042e32f74
515515
+import { LocalizationsService } from 'vs/workbench/services/localizations/electron-browser/localizationsService';
516516
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
517517
+import { Options } from 'vs/server/ipc.d';
518+
+import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
518519
+
519520
+class TelemetryService extends TelemetryChannelClient {
520521
+ public constructor(
@@ -725,6 +726,12 @@ index 0000000000..4042e32f74
725726
+ };
726727
+
727728
+ updateLoop();
729+
+
730+
+ // This will be used to set the background color while VS Code loads.
731+
+ const theme = (services.get(IStorageService) as IStorageService).get("colorThemeData", StorageScope.GLOBAL);
732+
+ if (theme) {
733+
+ localStorage.setItem("colorThemeData", theme);
734+
+ }
728735
+};
729736
+
730737
+export interface Query {

src/browser/pages/vscode.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,11 @@
100100
<script>
101101
require(["vs/code/browser/workbench/workbench"], function() {})
102102
</script>
103+
<script>
104+
try {
105+
document.body.style.background = JSON.parse(localStorage.getItem("colorThemeData")).colorMap["editor.background"]
106+
} catch (error) {
107+
// Oh well.
108+
}
109+
</script>
103110
</html>

0 commit comments

Comments
 (0)