Microsoft Developer Network >
Forums Home
>
Microsoft Visual Studio 2010 Beta 2 Forums
>
Visual Studio Editor
>
gradient of text selection is no good
gradient of text selection is no good
- In VS2010 the selection in the text editor has a gradient and a border. I find this nice but distracting for work. I would like to ba able to turn off this gradient and maybe also the border.
I would liketo add a screenshot here but do not know how to do that.
Answers
- If you go to Tools->Options->Environment, and1) Un-check "Automatically adjust visual experience based on client performance", and2) Make sure "Enable rich client experience" is uncheckedThe editor should switch to a simpler selection UI.-Noah
- Marked As Answer byBrittany BehrensMSFT, ModeratorThursday, June 04, 2009 12:41 AM
- Proposed As Answer byNoah RichardsMSFTTuesday, June 02, 2009 6:04 PM
- I'll also add that the look and feel of selection will likely change for the final release of VS 2010 - as you mention, the gradient is a bit distracting, and it can slow down performance somewhat. Noah's solution should mitigate this for Beta1, and you'll probably see something simpler and less obtrusive as the default in the next version.
Thanks for trying VS 2010 Beta1 and posting your feedback!
Brittany Behrens
Program Manager, VS Platform
http://blogs.msdn.com/vseditor- Marked As Answer byBrittany BehrensMSFT, ModeratorThursday, June 04, 2009 12:41 AM
All Replies
- If you go to Tools->Options->Environment, and1) Un-check "Automatically adjust visual experience based on client performance", and2) Make sure "Enable rich client experience" is uncheckedThe editor should switch to a simpler selection UI.-Noah
- Marked As Answer byBrittany BehrensMSFT, ModeratorThursday, June 04, 2009 12:41 AM
- Proposed As Answer byNoah RichardsMSFTTuesday, June 02, 2009 6:04 PM
- I'll also add that the look and feel of selection will likely change for the final release of VS 2010 - as you mention, the gradient is a bit distracting, and it can slow down performance somewhat. Noah's solution should mitigate this for Beta1, and you'll probably see something simpler and less obtrusive as the default in the next version.
Thanks for trying VS 2010 Beta1 and posting your feedback!
Brittany Behrens
Program Manager, VS Platform
http://blogs.msdn.com/vseditor- Marked As Answer byBrittany BehrensMSFT, ModeratorThursday, June 04, 2009 12:41 AM
- Thank you very much, that helps!
And compliments for the overall visual appearance of VS 2010, I like it a lot. It is just the selection gradient that I think goes too far.
cheers
~thomas - I have to disagree here. I think that the gradient and alpha blended selection from BETA 1 was incredibly good looking and a welcome change. It made it very clear what code blocks were selected and easy to trace it as you selected especially large blocks.
I am very disappointed that the feature is missing from Visual Studio 2010 BETA 2. I cant seem to find the options to turn it back on, is it completely missing from BETA 2?
Thanks, - That's certainly understandable.There are two answers to this:The first (and hopefully less important) answer is that the gradient selection is no longer an option you can select in tools->options. The rich and non-rich(?) client experience are both a solid color selection.However, the second answer is that you (or anyone) can write an extension to add the gradient back. The underlying code in the editor for drawing a gradient brush selection is still around, so you just need to override the editor's default selection brush.I'll work on putting an extension together that does this. When I'm done, I'll write something up on my blog about it (blogs.msdn.com/noahric), so watch there for any updates.Thanks,-Noah
- Thanks Noah,Thats a great idea and I think you would make a lot of people happy if you made that extension happen. Now that you threw the idea out there, I am also going to look into developing a custom extension, maybe we can share some ideas. Would be great if Microsoft was actually able to post their code if they have really removed the feature and shelved it. It sure seems that way since flagging the rich experience option no longer seems to make a difference. Maybe it will resurface as an explicit option in the Release Candidate.
- I'll dig up the old gradient definitions to share - my attempt at recreating it has made some really, really ugly gradients :), so I'm going to stop before I make myself sick from looking at them.Thanks,-Noah
- If you go here, you can see the code that does this:http://github.com/NoahRic/GradientSelectionIt matches the old behavior for picking a gradient; namely it uses the system highlight color at different opacities (you can see that in ViewCreationListener.cs).I haven't uploaded it to the vsgallery yet, but I should be able to get to that in the near future.Let me know if you get a chance to try it out. To build it, you'll need to install the SDK.Thanks,-Noah
- Proposed As Answer byNoah RichardsMSFTFriday, October 23, 2009 7:23 PM
- Hello Noah Richards.
I downloaded, compiled and added extension to Visual Studio 2010 Beta 2, but the gradient selection is not the beginning of work, but the list of extensions it is. Also not work and ItalicComments. what could be the problem?
Thank you. - I understand what was the problem. We had to put the checkbox (Environment -> Extension manager -> "Load per user extensions whenrunning as administrator"). After that, things started to work :)
- Hi Noah,
Your gradient plugin works awesome, it looks exactly like it did in Beta 1. I got it to compile and install just fine.
I noticed that inactive selection isnt implementd so I took the liberty to implement it. Can you merge this code into yours, goes at the bottom of SetGradientBrush()
// Changes by TheInitialCommand // Change theINACTIVE selected text properties to use a gradient brush and an outline pen Color inactiveHighlight = SystemColors.InactiveCaptionColor; Color inactiveDarkColor = Color.FromArgb(96, inactiveHighlight.R, inactiveHighlight.G, inactiveHighlight.B); Color inactiveLightColor = Color.FromArgb(48, inactiveHighlight.R, inactiveHighlight.G, inactiveHighlight.B); var inactiveProperties = formatMap.GetProperties("Inactive Selected Text"); inactiveProperties[EditorFormatDefinition.BackgroundBrushId] = new LinearGradientBrush( new GradientStopCollection() { new GradientStop(inactiveDarkColor, 0.0), new GradientStop(inactiveLightColor, 0.5), new GradientStop(inactiveDarkColor, 1.0) }, 90.0); //inactiveProperties["BackgroundPen"] = new Pen(SystemColors.HighlightBrush, 1) { LineJoin = PenLineJoin.Round }; inactiveProperties["BackgroundPen"] = new Pen(SystemColors.InactiveCaptionBrush, 1) { LineJoin = PenLineJoin.Round }; formatMap.SetProperties("Inactive Selected Text", inactiveProperties);
I have also noticed an issue when the user changes their colors the gradients get reset. Will need to introduce an event handler that calls SetGradientBrush when user 'fonts and colors' are updated.
Thanks for the great work! - Hey, thanks for the feedback.The code on github is Ms-PL, so feel free to fork it/change it/release your own extension based off it. The version I uploaded was meant to be more of a simple starting off point than a complete solution; as you pointed out, it is missing at least 3 things:1) Doesn't update correctly when the selection brush in the format map is changed by VS2) Doesn't change the inactive brush (this was partially because I'm not a big fan of the gradient gray)3) Uses SystemColors instead of using the VS specific settings in fonts and colorsLet me know if you have any questions.-Noah
- Also, for anyone else interested - I uploaded a version of this to vsgallery, so you can grab it from the extension manager in VS (search for "gradient"), or you can download it here:http://visualstudiogallery.msdn.microsoft.com/en-us/7687f71d-49aa-4cbd-b0ad-6f90c9a64572Thanks,-Noah
Hi Noah,
10x :) that is COOL
Your gradient plugin works awesome, it looks exactly like it did in Beta 1. I got it to compile and install just fine.
I noticed that inactive selection isnt implementd so I took the liberty to implement it. Can you merge this code into yours, goes at the bottom of SetGradientBrush()
// Changes by TheInitialCommand
// Change theINACTIVE selected text properties to use a gradient brush and an outline pen
Color inactiveHighlight = SystemColors.InactiveCaptionColor;
Color inactiveDarkColor = Color.FromArgb(96, inactiveHighlight.R, inactiveHighlight.G, inactiveHighlight.B);
Color inactiveLightColor = Color.FromArgb(48, inactiveHighlight.R, inactiveHighlight.G, inactiveHighlight.B);
var inactiveProperties = formatMap.GetProperties("Inactive Selected Text" );
inactiveProperties[EditorFormatDefinition.BackgroundBrushId] = new LinearGradientBrush(
new GradientStopCollection() { new GradientStop(inactiveDarkColor, 0.0), new GradientStop(inactiveLightColor, 0.5), new GradientStop(inactiveDarkColor, 1.0) },
90.0);
//inactiveProperties["BackgroundPen"] = new Pen(SystemColors.HighlightBrush, 1) { LineJoin = PenLineJoin.Round };
inactiveProperties["BackgroundPen" ] = new Pen(SystemColors.InactiveCaptionBrush, 1) { LineJoin = PenLineJoin.Round };
formatMap.SetProperties("Inactive Selected Text" , inactiveProperties);
I have also noticed an issue when the user changes their colors the gradients get reset. Will need to introduce an event handler that calls SetGradientBrush when user 'fonts and colors' are updated.
Thanks for the great work!

