mirror of
https://github.com/coder/code-server.git
synced 2024-11-27 10:09:51 +03:00
Set background color using VS Code theme
This commit is contained in:
parent
87ebf03eb7
commit
7954656610
@ -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 {
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user