[Bug] Snippet color

SyntaxEditor for WPF Forum

Posted 6 years ago by Mike
Version: 17.2.0664
Avatar

The highlight color for snippets is the same on Metro White and Metro Dark (which makes it unreadable on Metro Dark). You can quickly verify this using the sample browser.

Comments (5)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

Thanks for letting us know about that.  Our Dark.vssettings file (in the sample project) was missing entries for the two code snippet options.  We're making updates for the next build that will handle this.

In the meantime, you can get the two highlighting styles directly with and then change them yourself:

var style1 = AmbientHighlightingStyleRegistry.Instance[DisplayItemClassificationTypes.CodeSnippetField];
var style2 = AmbientHighlightingStyleRegistry.Instance[DisplayItemClassificationTypes.CodeSnippetDependentField];


Actipro Software Support

Posted 4 years ago by Martin - Blaise - Statistics Netherlands
Avatar

Hi

I see the marked variables in the inserted snippets are not readable. I change according to the theme background colors, text colors and the user adjustable colors.

Is there in the mean time an easy way to correct/adjust this code snippet UI colors or when can i change the registry to make this work?

[Modified 4 years ago]

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Martin,

The highlighting styles for the two special display item classification types mentioned above can be set in AmbientHighlightingStyleRegistry.  Those govern the appearance of the inserted snippet fields.  Have you tried customizing those yet?

If you can't sort it out, perhaps write our support address with a screenshot of what you see that you want changed, and tell us any related code you're trying in terms of customizing the highlighting style registry.  Please reference this thread in your e-mail.


Actipro Software Support

Posted 4 years ago by Martin - Blaise - Statistics Netherlands
Avatar

I fixed the backgrounds like this:

            var uiProv = new SyntaxEditor.DisplayItemClassificationTypeProvider(AmbientHighlightingStyleRegistry.Instance);
            var snfield = AmbientHighlightingStyleRegistry.Instance[uiProv.CodeSnippetField];
            snfield.Background = csColor;
            snfield = AmbientHighlightingStyleRegistry.Instance[uiProv.CodeSnippetDependentField];
            snfield.Background = csColor;

But the text colors i can not change. Is not that important:)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Martin,

Ahh, yes it will use the syntax highlighting for the text foreground.  I'd recommend using a "CodeSnippetField" background color closer to your editor background color if it conflicts with syntax-highlighted text foregrounds.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.