From 6019724a1d516b23554196118cbd4aa8d8a820f0 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 15 May 2017 22:49:39 +0200 Subject: [PATCH] Cannot Theme the 'No Definition Found' Popup. Fixes #25579 --- .../goToDeclaration/browser/messageController.css | 3 --- .../goToDeclaration/browser/messageController.ts | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/goToDeclaration/browser/messageController.css b/src/vs/editor/contrib/goToDeclaration/browser/messageController.css index 576dc53a636..36c68465b2c 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/messageController.css +++ b/src/vs/editor/contrib/goToDeclaration/browser/messageController.css @@ -25,8 +25,6 @@ .monaco-editor .monaco-editor-overlaymessage .message { padding: 1px 4px; - background: #1382CE; - color: white; } .monaco-editor .monaco-editor-overlaymessage .anchor { @@ -36,6 +34,5 @@ border-style: solid; z-index: 1000; border-width: 8px; - border-top-color: #1382CE; position: absolute; } diff --git a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts index d9422640154..d5453254827 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts @@ -17,6 +17,8 @@ import { commonEditorContribution, CommonEditorRegistry, EditorCommand } from 'v import { ICodeEditor, IContentWidget, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IPosition } from 'vs/editor/common/core/position'; +import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; +import { inputValidationInfoBorder, inputValidationInfoBackground } from 'vs/platform/theme/common/colorRegistry'; @commonEditorContribution export class MessageController { @@ -170,3 +172,16 @@ class MessageWidget implements IContentWidget { return { position: this._position, preference: [ContentWidgetPositionPreference.ABOVE] }; } } + +registerThemingParticipant((theme, collector) => { + let border = theme.getColor(inputValidationInfoBorder); + if (border) { + let borderWidth = theme.type === HIGH_CONTRAST ? 2 : 1; + collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .anchor { border-top-color: ${border}; }`); + collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { border: ${borderWidth}px solid ${border}; }`); + } + let background = theme.getColor(inputValidationInfoBackground); + if (background) { + collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`); + } +}); \ No newline at end of file -- GitLab