dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.38k stars 971 forks source link

Using solid border for selected control in the DemoConsole application. #11362

Closed LeafShi1 closed 4 months ago

LeafShi1 commented 4 months ago

Fixes #11353

Proposed changes

Regression?

Risk

Screenshots

Before

The selected control has a dashed border in the DemoConsole application. image

After

The selected control should have a solid border in the DemoConsole application. image

Test methodology

Test environment(s)

Microsoft Reviewers: Open in CodeFlow
Epica3055 commented 4 months ago

https://github.com/dotnet/winforms/blob/88abeb8e9d084f4b064a5fe841bb8af68f8905a7/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerUtils.cs#L159-L169

I am not sure if there is a case that will trigger SyncBrushes 🤔

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 74.27149%. Comparing base (88abeb8) to head (485c85b). Report is 6 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #11362 +/- ## =================================================== + Coverage 74.26862% 74.27149% +0.00287% =================================================== Files 3025 3025 Lines 626861 626861 Branches 46742 46742 =================================================== + Hits 465561 465579 +18 + Misses 157955 157938 -17 + Partials 3345 3344 -1 ``` | [Flag](https://app.codecov.io/gh/dotnet/winforms/pull/11362/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | Coverage Δ | | |---|---|---| | [Debug](https://app.codecov.io/gh/dotnet/winforms/pull/11362/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `74.27149% <50.00000%> (+0.00287%)` | :arrow_up: | | [integration](https://app.codecov.io/gh/dotnet/winforms/pull/11362/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `18.00367% <50.00000%> (-0.00212%)` | :arrow_down: | | [production](https://app.codecov.io/gh/dotnet/winforms/pull/11362/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `46.99678% <50.00000%> (+0.00632%)` | :arrow_up: | | [test](https://app.codecov.io/gh/dotnet/winforms/pull/11362/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `96.99415% <ø> (ø)` | | | [unit](https://app.codecov.io/gh/dotnet/winforms/pull/11362/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet) | `43.96863% <0.00000%> (+0.00876%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dotnet#carryforward-flags-in-the-pull-request-comment) to find out more.
LeafShi1 commented 4 months ago

https://github.com/dotnet/winforms/blob/88abeb8e9d084f4b064a5fe841bb8af68f8905a7/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/DesignerUtils.cs#L159-L169

I am not sure if there is a case that will trigger SyncBrushes 🤔

Updated the SyncBrushes method. After the VS theme is changed, SyncBrushes will be called, then the brushes to be recreated.