Skip to content

Changes and testing for 12042 review #13245

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pcblues
Copy link

@pcblues pcblues commented Apr 6, 2025

Fixes #12042 - TreeNode and ListItem not displaying in dark mode during editing, even though application is set to be in dark mode.

Proposed changes

If the application is in dark mode, capture the parent's windows message to identify the start of editing, and change the colour of the brush to match the parent's window color.

Customer Impact

Correction of incorrect color selection.

Regression?

  • Yes / No

Risk

I tried to limit the impact of the change to only occurring when the application is in dark mode. I'm not sure of the impact, if any, on custom ListView subitems, or custom-drawn TreeNodes.

Screenshots

Before

image

image

After

image

image

Test methodology

I used the test application provided to highlight the bug in the ticket to test the new behaviour.

Note that I added the following lines (uncommitted) to tests\integration\WinformsControlsTest\Program.cs
in order to enable dark mode.

It made the buttons look hard to read.
//Application.EnableVisualStyles();
//Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
#pragma warning disable WFO5001
Application.SetColorMode(SystemColorMode.Dark);

I haven't tested with the commented out option uncommented.

Accessibility testing

Test environment(s)

Microsoft Reviewers: Open in CodeFlow
Microsoft Reviewers: Open in CodeFlow
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Apr 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.77351%. Comparing base (851d52d) to head (8a01a47).

Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #13245          +/-   ##
====================================================
+ Coverage   39.78342%   61.77351%   +21.99009%     
====================================================
  Files           1018        1552         +534     
  Lines          96407      158950       +62543     
  Branches       13451       14803        +1352     
====================================================
+ Hits           38354       98189       +59835     
- Misses         57654       60046        +2392     
- Partials         399         715         +316     
Flag Coverage Δ
Debug 61.77351% <ø> (+21.99009%) ⬆️
integration 10.72623% <ø> (-0.00106%) ⬇️
production 39.78342% <ø> (ø)
test 95.67018% <ø> (?)
unit 37.22448% <ø> (+0.00104%) ⬆️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DarkMode Issues relating to Dark Mode feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dark Mode] The nodes of TreeView not in dark mode when editing it
2 participants