提交 ab5846a2 编写于 作者: A Alex Dima

Do not use `mix-blend-mode: difference` for `hc-black`

上级 d931da4b
...@@ -149,7 +149,7 @@ export class ViewLine implements IVisibleLine { ...@@ -149,7 +149,7 @@ export class ViewLine implements IVisibleLine {
this._options = newOptions; this._options = newOptions;
} }
public onSelectionChanged(): boolean { public onSelectionChanged(): boolean {
if (alwaysRenderInlineSelection) { if (alwaysRenderInlineSelection || this._options.themeType === HIGH_CONTRAST) {
this._isMaybeInvalid = true; this._isMaybeInvalid = true;
return true; return true;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import 'vs/css!./selections'; import 'vs/css!./selections';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { editorSelection, editorInactiveSelection, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { editorSelectionBackground, editorInactiveSelection, editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry';
import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';
import { ViewContext } from 'vs/editor/common/view/viewContext'; import { ViewContext } from 'vs/editor/common/view/viewContext';
import { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/common/view/renderingContext'; import { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/common/view/renderingContext';
...@@ -394,7 +394,7 @@ export class SelectionsOverlay extends DynamicViewOverlay { ...@@ -394,7 +394,7 @@ export class SelectionsOverlay extends DynamicViewOverlay {
} }
registerThemingParticipant((theme, collector) => { registerThemingParticipant((theme, collector) => {
let editorSelectionColor = theme.getColor(editorSelection); let editorSelectionColor = theme.getColor(editorSelectionBackground);
if (editorSelectionColor) { if (editorSelectionColor) {
collector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`); collector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`);
} }
...@@ -402,10 +402,8 @@ registerThemingParticipant((theme, collector) => { ...@@ -402,10 +402,8 @@ registerThemingParticipant((theme, collector) => {
if (editorInactiveSelectionColor) { if (editorInactiveSelectionColor) {
collector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`); collector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`);
} }
// IE/Edge specific rules let editorSelectionForegroundColor = theme.getColor(editorSelectionForeground);
let outline = theme.getColor(activeContrastBorder); if (editorSelectionForegroundColor) {
if (outline) { collector.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${editorSelectionForegroundColor}; }`);
collector.addRule(`.monaco-editor.ie.hc-black .view-overlays.focused .selected-text { background: none; border: 2px solid ${outline}; }`);
collector.addRule(`.monaco-editor.edge.hc-black .view-overlays.focused .selected-text { background: none; border: 2px solid ${outline}; }`);
} }
}); });
\ No newline at end of file
...@@ -6,6 +6,4 @@ ...@@ -6,6 +6,4 @@
.monaco-editor .vs-whitespace { .monaco-editor .vs-whitespace {
display:inline-block; display:inline-block;
} }
.monaco-editor.hc-black .view-line {
mix-blend-mode: difference;
}
...@@ -219,9 +219,10 @@ export const editorWidgetBorder = registerColor('editorWidget.border', { dark: ' ...@@ -219,9 +219,10 @@ export const editorWidgetBorder = registerColor('editorWidget.border', { dark: '
/** /**
* Editor selection colors. * Editor selection colors.
*/ */
export const editorSelection = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hc: '#f3f518' }, nls.localize('editorSelection', "Color of the editor selection.")); export const editorSelectionBackground = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hc: '#f3f518' }, nls.localize('editorSelectionBackground', "Color of the editor selection."));
export const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelection, 0.5), dark: transparent(editorSelection, 0.5), hc: null }, nls.localize('editorInactiveSelection', "Color of the selection in an inactive editor.")); export const editorSelectionForeground = registerColor('editor.selectionForeground', { light: null, dark: null, hc: '#000000' }, nls.localize('editorSelectionForeground', "Color of the selected text for high contrast."));
export const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelection, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelection, editorBackground, 0.3, 0.6), hc: null }, nls.localize('editorSelectionHighlight', 'Color for regions with the same content as the selection.')); export const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelectionBackground, 0.5), dark: transparent(editorSelectionBackground, 0.5), hc: transparent(editorSelectionBackground, 0.5) }, nls.localize('editorInactiveSelection', "Color of the selection in an inactive editor."));
export const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), hc: null }, nls.localize('editorSelectionHighlight', 'Color for regions with the same content as the selection.'));
/** /**
* Editor find match colors. * Editor find match colors.
......
...@@ -53,7 +53,7 @@ export function convertSettings(oldSettings: ITokenColorizationRule[], resultRul ...@@ -53,7 +53,7 @@ export function convertSettings(oldSettings: ITokenColorizationRule[], resultRul
addSettingMapping('background', colorRegistry.editorBackground); addSettingMapping('background', colorRegistry.editorBackground);
addSettingMapping('foreground', colorRegistry.editorForeground); addSettingMapping('foreground', colorRegistry.editorForeground);
addSettingMapping('selection', colorRegistry.editorSelection); addSettingMapping('selection', colorRegistry.editorSelectionBackground);
addSettingMapping('inactiveSelection', colorRegistry.editorInactiveSelection); addSettingMapping('inactiveSelection', colorRegistry.editorInactiveSelection);
addSettingMapping('selectionHighlightColor', colorRegistry.editorSelectionHighlight); addSettingMapping('selectionHighlightColor', colorRegistry.editorSelectionHighlight);
addSettingMapping('findMatchHighlight', colorRegistry.editorFindMatchHighlight); addSettingMapping('findMatchHighlight', colorRegistry.editorFindMatchHighlight);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册