Skip to content

Added theme-specific background for XAML code errors #3588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
6 commits merged into from
Dec 5, 2020

Conversation

winston-de
Copy link
Contributor

Fixes #3545

Adds a theme listener field and a read only property that returns the theme-specific error background color to the sample app's Xaml code editor.

PR Type

What kind of change does this PR introduce?

Bugfix

Sample app changes

What is the current behavior?

Quoting from #3545

Errors in the XAML Sample are hard to read as the background-red does not work well with text:

What is the new behavior?

A different text background is now displayed when dark theme is enabled, making it more readable.
image

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • [N/A] Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
    • [N/A] Icon has been created (if new sample) following the Thumbnail Style Guide and templates
  • [N/A] Tests for the changes have been added (for bug fixes / features) (if applicable)
  • [N/A] Header has been added to all new source files (run build/UpdateHeaders.bat) (None added)
  • Contains NO breaking changes

@ghost
Copy link

ghost commented Nov 30, 2020

Thanks winston-de for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker, azchohfi and Kyaa-dost November 30, 2020 03:33
@ghost ghost added bug 🐛 An unexpected issue that highlights incorrect behavior sample app 🖼 labels Nov 30, 2020
Copy link
Contributor

@Kyaa-dost Kyaa-dost left a comment

Choose a reason for hiding this comment

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

@winston-de Thanks for the PR. Looks great 🚀 🚀

@Kyaa-dost
Copy link
Contributor

@chingucoding feel free to check it out 😊

};
get => _themeListener.CurrentTheme.Equals(ApplicationTheme.Light) ?
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xD6, 0xD6)) } :
new CssLineStyle() { BackgroundColor = new SolidColorBrush(Color.FromArgb(0x00, 0x6E, 0x00, 0x00)) };
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use #660000 for dark theme? That way, we would achieve a contrast of 4.5:1 to the darker blue.

Thanks @Kyaa-dost for pinging me on this PR!

@winston-de
Copy link
Contributor Author

@chingucoding
Updated background:
image

Copy link
Contributor

@marcelwgn marcelwgn left a comment

Choose a reason for hiding this comment

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

Thanks @winston-de , looks good to me!

@Kyaa-dost Kyaa-dost added this to the 7.0 milestone Dec 4, 2020
@ghost ghost added the in progress 🚧 label Dec 4, 2020
@ghost
Copy link

ghost commented Dec 4, 2020

Hello @Kyaa-dost!

Because this pull request has the auto merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@Kyaa-dost
Copy link
Contributor

@msftbot merge this PR once @michael-hawker approves 🚀 🚀

@ghost
Copy link

ghost commented Dec 4, 2020

Hello @Kyaa-dost!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 9b75c9f into CommunityToolkit:master Dec 5, 2020
@michael-hawker
Copy link
Member

Thanks @winston-de for jumping in and submitting this fix! 🎉🎉🎉

@winston-de
Copy link
Contributor Author

Thanks @winston-de for jumping in and submitting this fix! 🎉🎉🎉

no problem :)

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merge ⚡ bug 🐛 An unexpected issue that highlights incorrect behavior in progress 🚧 sample app 🖼
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sample App: Sample code errors are hard to read
4 participants