Skip to content
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

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

Merged

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented May 13, 2024

Fixes #11353

Proposed changes

  • Changing the selectionBorderBrush to use SystemColors.ControlDarkDark instead of Color.Transparent as backcolor

Regression?

  • No

Risk

  • Minimal

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

  • Manually

Test environment(s)

  • .net 9.0.0-preview.5.24258.12
Microsoft Reviewers: Open in CodeFlow

@Epica3055
Copy link
Member

// Recreate the brushes - behaviorservice calls this when the user preferences changes
public static void SyncBrushes()
{
s_hoverBrush.Dispose();
s_hoverBrush = new SolidBrush(Color.FromArgb(50, SystemColors.Highlight));
s_selectionBorderBrush.Dispose();
s_selectionBorderBrush = new HatchBrush(HatchStyle.Percent50, SystemColors.ControlDarkDark, Color.Transparent);
PInvokeCore.DeleteObject(s_grabHandleFillBrushPrimary);

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

Copy link

codecov bot commented May 13, 2024

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
@@                 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 Coverage Δ
Debug 74.27149% <50.00000%> (+0.00287%) ⬆️
integration 18.00367% <50.00000%> (-0.00212%) ⬇️
production 46.99678% <50.00000%> (+0.00632%) ⬆️
test 96.99415% <ø> (ø)
unit 43.96863% <0.00000%> (+0.00876%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@Tanya-Solyanik Tanya-Solyanik added the 📭 waiting-author-feedback The team requires more information from the author label May 13, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label May 14, 2024
@LeafShi1
Copy link
Member Author

// Recreate the brushes - behaviorservice calls this when the user preferences changes
public static void SyncBrushes()
{
s_hoverBrush.Dispose();
s_hoverBrush = new SolidBrush(Color.FromArgb(50, SystemColors.Highlight));
s_selectionBorderBrush.Dispose();
s_selectionBorderBrush = new HatchBrush(HatchStyle.Percent50, SystemColors.ControlDarkDark, Color.Transparent);
PInvokeCore.DeleteObject(s_grabHandleFillBrushPrimary);

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.

@elachlan elachlan added the waiting-review This item is waiting on review by one or more members of team label May 15, 2024
@LeafShi1 LeafShi1 merged commit dff9619 into dotnet:main May 17, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0 Preview5 milestone May 17, 2024
@dotnet-policy-service dotnet-policy-service bot removed the waiting-review This item is waiting on review by one or more members of team label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The selected control should have a solid border in the DemoConsole application
4 participants