-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make high contrast detection configurable #17394
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi | |
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; | ||
import { IMessageService } from 'vs/platform/message/common/message'; | ||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; | ||
import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows'; | ||
import { IWindowsService, IWindowService, IWindowSettings } from 'vs/platform/windows/common/windows'; | ||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; | ||
import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; | ||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; | ||
|
@@ -258,15 +258,21 @@ export class ElectronWindow { | |
|
||
// High Contrast Events | ||
ipc.on('vscode:enterHighContrast', (event) => { | ||
this.partService.joinCreation().then(() => { | ||
this.themeService.setColorTheme(VS_HC_THEME, false); | ||
}); | ||
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window'); | ||
if (windowConfig.autoDetectHighContrast) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
this.partService.joinCreation().then(() => { | ||
this.themeService.setColorTheme(VS_HC_THEME, false); | ||
}); | ||
} | ||
}); | ||
|
||
ipc.on('vscode:leaveHighContrast', (event) => { | ||
this.partService.joinCreation().then(() => { | ||
this.themeService.setColorTheme(VS_DARK_THEME, false); | ||
}); | ||
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can ignore the setting in this case because leaving HC on Windows you want to switch back to dark theme. Or otherwise the setting should be clearer that it prevents switching in both ways, not just from normal to HC theme. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have expanded the setting description. I feel if this settings is disabled, nothing should happen automatically when changing to/from windows HC theme. |
||
if (windowConfig.autoDetectHighContrast) { | ||
this.partService.joinCreation().then(() => { | ||
this.themeService.setColorTheme(VS_DARK_THEME, false); | ||
}); | ||
} | ||
}); | ||
|
||
// Configuration changes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing trailing comma.