This commit is contained in:
isidor 2021-03-29 12:56:05 +02:00
parent e5b2742fff
commit ce184d9ec7
No known key found for this signature in database
GPG key ID: F9280366A8370105

View file

@ -9,7 +9,7 @@ import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentW
import { localize } from 'vs/nls';
import { DEFAULT_FONT_FAMILY } from 'vs/workbench/browser/style';
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry';
import { inputPlaceholderForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry';
import { ChangeModeAction } from 'vs/workbench/browser/parts/editor/editorStatus';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';
@ -118,7 +118,8 @@ class UntitledHintContentWidget implements IContentWidget {
if (!this.domNode) {
this.domNode = $('.untitled-hint');
this.domNode.style.width = 'max-content';
const language = $('span.language-mode.detected-link-active');
const language = $('a.language-mode');
language.style.cursor = 'pointer';
const keybinding = this.keybindingService.lookupKeybinding(ChangeModeAction.ID);
const keybindingLabel = keybinding?.getLabel();
const keybindingWithBrackets = keybindingLabel ? `(${keybindingLabel})` : '';
@ -128,7 +129,8 @@ class UntitledHintContentWidget implements IContentWidget {
toGetStarted.innerText = localize('toGetStarted', " to get started. Start typing to dismiss, or ",);
this.domNode.appendChild(toGetStarted);
const dontShow = $('span.detected-link-active');
const dontShow = $('a');
dontShow.style.cursor = 'pointer';
dontShow.innerText = localize('dontshow', "don't show");
this.domNode.appendChild(dontShow);
@ -180,4 +182,8 @@ registerThemingParticipant((theme, collector) => {
if (inputPlaceholderForegroundColor) {
collector.addRule(`.monaco-editor .contentWidgets .untitled-hint { color: ${inputPlaceholderForegroundColor}; }`);
}
const textLinkForegroundColor = theme.getColor(textLinkForeground);
if (textLinkForegroundColor) {
collector.addRule(`.monaco-editor .contentWidgets .untitled-hint a { color: ${textLinkForegroundColor}; }`);
}
});