Skip to content

Add Selection Background Color as a setting to Profiles and Col…#3471

Merged
zadjii-msft merged 20 commits intomasterfrom
dev/lelian/selectionBackgroundColor
Nov 13, 2019
Merged

Add Selection Background Color as a setting to Profiles and Col…#3471
zadjii-msft merged 20 commits intomasterfrom
dev/lelian/selectionBackgroundColor

Conversation

@leonMSFT
Copy link
Contributor

@leonMSFT leonMSFT commented Nov 7, 2019

Summary of the Pull Request

This introduces a setting to both Profiles and ColorSchemes called selectionBackground that allows you to change the selection background color to what's specified. If selectionBackground isn't set in either the profile or color scheme, it'll default to what it was before - white.

PR Checklist

Validation Steps Performed

  • Added selectionBackground to existing profile and colorscheme tests.
  • Verified that the color does change to what I expect it to be when I add "selectionBackground" to either/both a profile and a color scheme.

@mdtauk
Copy link

mdtauk commented Nov 7, 2019

Is there already a SelectionForeground colour?

@leonMSFT
Copy link
Contributor Author

leonMSFT commented Nov 7, 2019

@mdtauk Nope! There is not currently a setting for SelectionForeground.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely looks good. Setting is plumbed through all the places it needs to be plumbed through.

Though, maybe it makes more sense to just have this be a property on the DxEngine, and not necessarily a part of TerminalCore. Maybe the setting should be moved to IControlSettings, and just set a property of the DxRenderer, instead of needing to plumb it all the way down to the TerminalCore and having it then tell the renderer each frame what the BG color should be. Further, then each of the other engines wouldn't need to have that added param on their PaintSelection methods. Plus, conhost wouldn't need to implement anything special at all to handle this, it would just leave the value unchanged (with a default of DEFAULT_FOREGROUND). Thoughts?

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 11, 2019
@zadjii-msft zadjii-msft added Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Nov 11, 2019
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 12, 2019
@leonMSFT
Copy link
Contributor Author

@zadjii-msft Thanks for the suggestions! Putting the setting in IControlSettings and letting TermControl update the color in DxEngine really cut down on the amount of files I needed to touch.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is all okay except for that one _selectionBackground thing.

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 13, 2019
@zadjii-msft zadjii-msft changed the title Add Selection Background Color as a setting to Profiles and ColorSchemes Add Selection Background Color as a setting to Profiles and Col… Nov 13, 2019
@zadjii-msft zadjii-msft merged commit a404778 into master Nov 13, 2019
@javierdlg
Copy link
Member

Thanks for the quick turnaround!

@ghost
Copy link

ghost commented Nov 26, 2019

🎉Windows Terminal Preview v0.7.3291.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a setting to control selection background color

5 participants