mirror of https://git.tuxpa.in/a/code-server.git
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:`);
|
options.logService.error(`${logPrefix} socketFactory.connect() failed. Error:`);
|
||||||
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
|
diff --git a/src/vs/server/browser/client.ts b/src/vs/server/browser/client.ts
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000..4042e32f74
|
index 0000000000..96fbd4b0bb
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/vs/server/browser/client.ts
|
+++ b/src/vs/server/browser/client.ts
|
||||||
@@ -0,0 +1,263 @@
|
@@ -0,0 +1,270 @@
|
||||||
+import { Emitter } from 'vs/base/common/event';
|
+import { Emitter } from 'vs/base/common/event';
|
||||||
+import { URI } from 'vs/base/common/uri';
|
+import { URI } from 'vs/base/common/uri';
|
||||||
+import { localize } from 'vs/nls';
|
+import { localize } from 'vs/nls';
|
||||||
|
@ -515,6 +515,7 @@ index 0000000000..4042e32f74
|
||||||
+import { LocalizationsService } from 'vs/workbench/services/localizations/electron-browser/localizationsService';
|
+import { LocalizationsService } from 'vs/workbench/services/localizations/electron-browser/localizationsService';
|
||||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||||
+import { Options } from 'vs/server/ipc.d';
|
+import { Options } from 'vs/server/ipc.d';
|
||||||
|
+import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||||
+
|
+
|
||||||
+class TelemetryService extends TelemetryChannelClient {
|
+class TelemetryService extends TelemetryChannelClient {
|
||||||
+ public constructor(
|
+ public constructor(
|
||||||
|
@ -725,6 +726,12 @@ index 0000000000..4042e32f74
|
||||||
+ };
|
+ };
|
||||||
+
|
+
|
||||||
+ updateLoop();
|
+ 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 {
|
+export interface Query {
|
||||||
|
|
|
@ -100,4 +100,11 @@
|
||||||
<script>
|
<script>
|
||||||
require(["vs/code/browser/workbench/workbench"], function() {})
|
require(["vs/code/browser/workbench/workbench"], function() {})
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
try {
|
||||||
|
document.body.style.background = JSON.parse(localStorage.getItem("colorThemeData")).colorMap["editor.background"]
|
||||||
|
} catch (error) {
|
||||||
|
// Oh well.
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue