mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
Add separate color id for overviewRuler colors, revert color changes. Fixes #33488
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import nls = require('vs/nls');
|
||||
import { registerColor, editorBackground, activeContrastBorder, editorForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { Color, RGBA } from 'vs/base/common/color';
|
||||
|
||||
/**
|
||||
* Definition of the editor colors
|
||||
@@ -36,6 +36,9 @@ export const editorErrorBorder = registerColor('editorError.border', { dark: nul
|
||||
export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('warningForeground', 'Foreground color of warning squigglies in the editor.'));
|
||||
export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning squigglies in the editor.'));
|
||||
|
||||
const rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6));
|
||||
export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', { dark: rulerRangeDefault, light: rulerRangeDefault, hc: rulerRangeDefault }, nls.localize('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights.'));
|
||||
|
||||
// contains all color rules that used to defined in editor/browser/widget/editor.css
|
||||
registerThemingParticipant((theme, collector) => {
|
||||
let background = theme.getColor(editorBackground);
|
||||
|
||||
@@ -23,7 +23,7 @@ import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/comm
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations';
|
||||
import { editorSelectionHighlight } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export const enum FindStartFocusAction {
|
||||
@@ -1106,8 +1106,8 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'selectionHighlight',
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorSelectionHighlight),
|
||||
darkColor: themeColorFromId(editorSelectionHighlight),
|
||||
color: themeColorFromId(overviewRulerSelectionHighlightForeground),
|
||||
darkColor: themeColorFromId(overviewRulerSelectionHighlightForeground),
|
||||
position: editorCommon.OverviewRulerLane.Center
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ import { CommonEditorRegistry, commonEditorContribution } from 'vs/editor/common
|
||||
import { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProviderRegistry } from 'vs/editor/common/modes';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { registerColor, editorSelectionHighlight, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerColor, editorSelectionHighlight, activeContrastBorder, overviewRulerSelectionHighlightForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService';
|
||||
import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations';
|
||||
@@ -23,6 +23,8 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDeco
|
||||
export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable.'));
|
||||
export const editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable.'));
|
||||
|
||||
export const overviewRulerWordHighlightForeground = registerColor('editorOverviewRuler.wordHighlightForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerWordHighlightForeground', 'Overview ruler marker color for symbol highlights.'));
|
||||
|
||||
export function getOccurrencesAtPosition(model: editorCommon.IReadOnlyModel, position: Position): TPromise<DocumentHighlight[]> {
|
||||
|
||||
const orderedByScore = DocumentHighlightProviderRegistry.ordered(model);
|
||||
@@ -294,8 +296,8 @@ class WordHighlighter {
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'wordHighlightStrong',
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorWordHighlightStrong),
|
||||
darkColor: themeColorFromId(editorWordHighlightStrong),
|
||||
color: themeColorFromId(overviewRulerWordHighlightForeground),
|
||||
darkColor: themeColorFromId(overviewRulerWordHighlightForeground),
|
||||
position: editorCommon.OverviewRulerLane.Center
|
||||
}
|
||||
});
|
||||
@@ -304,8 +306,8 @@ class WordHighlighter {
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'selectionHighlight',
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorSelectionHighlight),
|
||||
darkColor: themeColorFromId(editorSelectionHighlight),
|
||||
color: themeColorFromId(overviewRulerSelectionHighlightForeground),
|
||||
darkColor: themeColorFromId(overviewRulerSelectionHighlightForeground),
|
||||
position: editorCommon.OverviewRulerLane.Center
|
||||
}
|
||||
});
|
||||
@@ -314,8 +316,8 @@ class WordHighlighter {
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'wordHighlight',
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorWordHighlight),
|
||||
darkColor: themeColorFromId(editorWordHighlight),
|
||||
color: themeColorFromId(overviewRulerWordHighlightForeground),
|
||||
darkColor: themeColorFromId(overviewRulerWordHighlightForeground),
|
||||
position: editorCommon.OverviewRulerLane.Center
|
||||
}
|
||||
});
|
||||
|
||||
@@ -297,6 +297,12 @@ export const overviewRulerCurrentContentForeground = registerColor('editorOvervi
|
||||
export const overviewRulerIncomingContentForeground = registerColor('editorOverviewRuler.incomingContentForeground', { dark: transparent(mergeIncomingHeaderBackground, rulerTransparency), light: transparent(mergeIncomingHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerIncomingContentForeground', 'Incoming overview ruler foreground for inline merge-conflicts.'));
|
||||
export const overviewRulerCommonContentForeground = registerColor('editorOverviewRuler.commonContentForeground', { dark: transparent(mergeCommonHeaderBackground, rulerTransparency), light: transparent(mergeCommonHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerCommonContentForeground', 'Common ancestor overview ruler foreground for inline merge-conflicts.'));
|
||||
|
||||
const findMatchColorDefault = new Color(new RGBA(246, 185, 77, 0.7));
|
||||
export const overviewRulerFindMatchForeground = registerColor('editorOverviewRuler.findMatchForeground', { dark: findMatchColorDefault, light: findMatchColorDefault, hc: findMatchColorDefault }, nls.localize('overviewRulerFindMatchForeground', 'Overview ruler marker color for find matches.'));
|
||||
|
||||
export const overviewRulerSelectionHighlightForeground = registerColor('editorOverviewRuler.selectionHighlightForeground', { dark: '#A0A0A0', light: '#A0A0A0', hc: '#A0A0A0' }, nls.localize('overviewRulerSelectionHighlightForeground', 'Overview ruler marker color for selection highlights.'));
|
||||
|
||||
|
||||
// ----- color functions
|
||||
|
||||
export function darken(colorValue: ColorValue, factor: number): ColorFunction {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { Position, IEditorInput, ITextEditorOptions } from 'vs/platform/editor/c
|
||||
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { editorRangeHighlight } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export const GOTO_LINE_PREFIX = ':';
|
||||
@@ -221,8 +221,8 @@ export class GotoLineHandler extends QuickOpenHandler {
|
||||
range: range,
|
||||
options: {
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorRangeHighlight),
|
||||
darkColor: themeColorFromId(editorRangeHighlight),
|
||||
color: themeColorFromId(overviewRulerRangeHighlight),
|
||||
darkColor: themeColorFromId(overviewRulerRangeHighlight),
|
||||
position: OverviewRulerLane.Full
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import { DocumentSymbolProviderRegistry, SymbolInformation, symbolKindToCssClass
|
||||
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
|
||||
import { editorRangeHighlight } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRegistry';
|
||||
|
||||
export const GOTO_SYMBOL_PREFIX = '@';
|
||||
export const SCOPE_PREFIX = ':';
|
||||
@@ -531,8 +531,8 @@ export class GotoSymbolHandler extends QuickOpenHandler {
|
||||
range: startRange,
|
||||
options: {
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorRangeHighlight),
|
||||
darkColor: themeColorFromId(editorRangeHighlight),
|
||||
color: themeColorFromId(overviewRulerRangeHighlight),
|
||||
darkColor: themeColorFromId(overviewRulerRangeHighlight),
|
||||
position: OverviewRulerLane.Full
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import nls = require('vs/nls');
|
||||
|
||||
import 'vs/css!./media/dirtydiffDecorator';
|
||||
import { ThrottledDelayer, always } from 'vs/base/common/async';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
@@ -26,7 +28,7 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDeco
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector, themeColorFromId } from 'vs/platform/theme/common/themeService';
|
||||
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { localize } from 'vs/nls';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { Color, RGBA } from 'vs/base/common/color';
|
||||
|
||||
export const editorGutterModifiedBackground = registerColor('editorGutter.modifiedBackground', {
|
||||
dark: Color.fromHex('#00bcf2').transparent(0.6),
|
||||
@@ -47,14 +49,20 @@ export const editorGutterDeletedBackground = registerColor('editorGutter.deleted
|
||||
}, localize('editorGutterDeletedBackground', "Editor gutter background color for lines that are deleted."));
|
||||
|
||||
|
||||
const overviewRulerDefault = new Color(new RGBA(0, 122, 204, 0.6));
|
||||
export const overviewRulerModifiedForeground = registerColor('editorOverviewRuler.modifiedForeground', { dark: overviewRulerDefault, light: overviewRulerDefault, hc: overviewRulerDefault }, nls.localize('overviewRulerModifiedForeground', 'Overview ruler marker color for modified content.'));
|
||||
export const overviewRulerAddedForeground = registerColor('editorOverviewRuler.addedForeground', { dark: overviewRulerDefault, light: overviewRulerDefault, hc: overviewRulerDefault }, nls.localize('overviewRulerAddedForeground', 'Overview ruler marker color for added content.'));
|
||||
export const overviewRulerDeletedForeground = registerColor('editorOverviewRuler.deletedForeground', { dark: overviewRulerDefault, light: overviewRulerDefault, hc: overviewRulerDefault }, nls.localize('overviewRulerDeletedForeground', 'Overview ruler marker color for deleted content.'));
|
||||
|
||||
|
||||
class DirtyDiffModelDecorator {
|
||||
|
||||
static MODIFIED_DECORATION_OPTIONS = ModelDecorationOptions.register({
|
||||
linesDecorationsClassName: 'dirty-diff-modified-glyph',
|
||||
isWholeLine: true,
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorGutterModifiedBackground),
|
||||
darkColor: themeColorFromId(editorGutterModifiedBackground),
|
||||
color: themeColorFromId(overviewRulerModifiedForeground),
|
||||
darkColor: themeColorFromId(overviewRulerModifiedForeground),
|
||||
position: common.OverviewRulerLane.Left
|
||||
}
|
||||
});
|
||||
@@ -63,8 +71,8 @@ class DirtyDiffModelDecorator {
|
||||
linesDecorationsClassName: 'dirty-diff-added-glyph',
|
||||
isWholeLine: true,
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorGutterAddedBackground),
|
||||
darkColor: themeColorFromId(editorGutterAddedBackground),
|
||||
color: themeColorFromId(overviewRulerAddedForeground),
|
||||
darkColor: themeColorFromId(overviewRulerAddedForeground),
|
||||
position: common.OverviewRulerLane.Left
|
||||
}
|
||||
});
|
||||
@@ -73,8 +81,8 @@ class DirtyDiffModelDecorator {
|
||||
linesDecorationsClassName: 'dirty-diff-deleted-glyph',
|
||||
isWholeLine: true,
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorGutterDeletedBackground),
|
||||
darkColor: themeColorFromId(editorGutterDeletedBackground),
|
||||
color: themeColorFromId(overviewRulerDeletedForeground),
|
||||
darkColor: themeColorFromId(overviewRulerDeletedForeground),
|
||||
position: common.OverviewRulerLane.Left
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ import { IReplaceService } from 'vs/workbench/parts/search/common/replace';
|
||||
import { IProgressRunner } from 'vs/platform/progress/common/progress';
|
||||
import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations';
|
||||
import { editorFindMatchHighlight } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { overviewRulerFindMatchForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { themeColorFromId } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export class Match {
|
||||
@@ -98,8 +98,8 @@ export class FileMatch extends Disposable {
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'currentFindMatch',
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorFindMatchHighlight),
|
||||
darkColor: themeColorFromId(editorFindMatchHighlight),
|
||||
color: themeColorFromId(overviewRulerFindMatchForeground),
|
||||
darkColor: themeColorFromId(overviewRulerFindMatchForeground),
|
||||
position: OverviewRulerLane.Center
|
||||
}
|
||||
});
|
||||
@@ -108,8 +108,8 @@ export class FileMatch extends Disposable {
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'findMatch',
|
||||
overviewRuler: {
|
||||
color: themeColorFromId(editorFindMatchHighlight),
|
||||
darkColor: themeColorFromId(editorFindMatchHighlight),
|
||||
color: themeColorFromId(overviewRulerFindMatchForeground),
|
||||
darkColor: themeColorFromId(overviewRulerFindMatchForeground),
|
||||
position: OverviewRulerLane.Center
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user