Skip to content

Commit

Permalink
Register a new color instead of theme participant
Browse files Browse the repository at this point in the history
Part of #165169
  • Loading branch information
Tyriar committed Feb 28, 2023
1 parent f164298 commit 4b98001
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 4 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/media/terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@
background-color: var(--vscode-scrollbarSlider-background) !important;
}

.monaco-workbench .integrated-terminal .hoverHighlight {
background-color: var(--vscode-terminal-hoverHighlightBackground);
}

.monaco-workbench .editor-instance .xterm-viewport,
.monaco-workbench .pane-body.integrated-terminal .xterm-viewport {
scrollbar-color: var(--vscode-scrollbarSlider-background) transparent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { ITerminalWidget } from 'vs/workbench/contrib/terminal/browser/widgets/w
import * as dom from 'vs/base/browser/dom';
import type { IViewportRange } from 'xterm';
import { IHoverTarget, IHoverService, IHoverAction } from 'vs/workbench/services/hover/browser/hover';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { editorHoverHighlight } from 'vs/platform/theme/common/colorRegistry';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';

Expand Down Expand Up @@ -131,13 +129,3 @@ class CellHoverTarget extends Widget implements IHoverTarget {
super.dispose();
}
}

registerThemingParticipant((theme, collector) => {
let editorHoverHighlightColor = theme.getColor(editorHoverHighlight);
if (editorHoverHighlightColor) {
if (editorHoverHighlightColor.isOpaque()) {
editorHoverHighlightColor = editorHoverHighlightColor.transparent(0.5);
}
collector.addRule(`.integrated-terminal .hoverHighlight { background-color: ${editorHoverHighlightColor}; }`);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import * as nls from 'vs/nls';

import { registerColor, ColorIdentifier, ColorDefaults, editorFindMatch, editorFindMatchHighlight, overviewRulerFindMatchForeground, editorSelectionBackground, transparent } from 'vs/platform/theme/common/colorRegistry';
import { registerColor, ColorIdentifier, ColorDefaults, editorFindMatch, editorFindMatchHighlight, overviewRulerFindMatchForeground, editorSelectionBackground, transparent, editorHoverHighlight } from 'vs/platform/theme/common/colorRegistry';
import { EDITOR_DRAG_AND_DROP_BACKGROUND, PANEL_BORDER, TAB_ACTIVE_BORDER } from 'vs/workbench/common/theme';

/**
Expand Down Expand Up @@ -78,6 +78,12 @@ export const TERMINAL_FIND_MATCH_BACKGROUND_COLOR = registerColor('terminal.find
hcDark: null,
hcLight: '#0F4A85'
}, nls.localize('terminal.findMatchBackground', 'Color of the current search match in the terminal. The color must not be opaque so as not to hide underlying terminal content.'));
export const TERMINAL_HOVER_HIGHLIGHT_BACKGROUND_COLOR = registerColor('terminal.hoverHighlightBackground', {
dark: transparent(editorHoverHighlight, 0.5),
light: transparent(editorHoverHighlight, 0.5),
hcDark: transparent(editorHoverHighlight, 0.5),
hcLight: transparent(editorHoverHighlight, 0.5)
}, nls.localize('terminal.findMatchHighlightBorder', 'Border color of the other search matches in the terminal.'));
export const TERMINAL_FIND_MATCH_BORDER_COLOR = registerColor('terminal.findMatchBorder', {
dark: null,
light: null,
Expand Down

0 comments on commit 4b98001

Please sign in to comment.