From c6942998c36b967842b80ecea86abe2eb6bc9280 Mon Sep 17 00:00:00 2001 From: Big Boss Date: Wed, 20 Nov 2024 23:26:53 -0600 Subject: [PATCH] fix getTheme to respect preferred mode previously the getTheme function would only inspect the workbench.colorTheme. This would not work for users who use window.autoDetectColorScheme. Now, we inspect this value before deciding which color theme to use. --- .../src/ContinueGUIWebviewViewProvider.ts | 12 +++- extensions/vscode/src/util/getTheme.ts | 55 +++++++++++++++++-- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts b/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts index 8c8c399a7..610d262fc 100644 --- a/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts +++ b/extensions/vscode/src/ContinueGUIWebviewViewProvider.ts @@ -168,7 +168,15 @@ export class ContinueGUIWebviewViewProvider const currentTheme = getTheme(); vscode.workspace.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration("workbench.colorTheme")) { + if ( + e.affectsConfiguration("workbench.colorTheme") || + e.affectsConfiguration("window.autoDetectColorScheme") || + e.affectsConfiguration("window.autoDetectHighContrast") || + e.affectsConfiguration("workbench.preferredDarkColorTheme") || + e.affectsConfiguration("workbench.preferredLightColorTheme") || + e.affectsConfiguration("workbench.preferredHighContrastColorTheme") || + e.affectsConfiguration("workbench.preferredHighContrastLightColorTheme") + ) { // Send new theme to GUI to update embedded Monaco themes this.webviewProtocol?.request("setTheme", { theme: getTheme() }); } @@ -188,7 +196,7 @@ export class ContinueGUIWebviewViewProvider
- + ${ inDevelopmentMode ? `