Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f46d053

Browse files
authoredJul 22, 2022
use window.matchMedia in loadSettings
1 parent 7b1c34a commit f46d053

File tree

1 file changed

+8
-0
lines changed
  • arduino-ide-extension/src/browser/dialogs/settings

1 file changed

+8
-0
lines changed
 

‎arduino-ide-extension/src/browser/dialogs/settings/settings.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export class SettingsService {
122122
languages,
123123
currentLanguage,
124124
editorFontSize,
125+
themeId,
125126
autoSave,
126127
quickSuggestions,
127128
autoScaleInterface,
@@ -136,6 +137,13 @@ export class SettingsService {
136137
['en', ...(await this.localizationProvider.getAvailableLanguages())],
137138
this.localizationProvider.getCurrentLanguage(),
138139
this.preferenceService.get<number>(FONT_SIZE_SETTING, 12),
140+
this.preferenceService.get<string>(
141+
'workbench.colorTheme',
142+
window.matchMedia &&
143+
window.matchMedia('(prefers-color-scheme: dark)').matches
144+
? 'arduino-theme-dark'
145+
: 'arduino-theme'
146+
),
139147
this.preferenceService.get<Settings.AutoSave>(
140148
AUTO_SAVE_SETTING,
141149
Settings.AutoSave.DEFAULT_ON

0 commit comments

Comments
 (0)
Please sign in to comment.