Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 24, 2025

Fixes #14167

Root Cause

Icons similar to HSplit.cur, VSplit.cur are wider than other icons at certain DPI settings (such as 125%, 175%, 225%, 250%), which is causing the webtable to display abnormally.

Proposed changes

  • Modify the drawing method for list items to use the default icon width as a reference, ensuring that all icons are the same size.

Customer Impact

  • Cursor editor items are displayed correctly in propertyGrid with all DPI settings.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

image

After

150DPI:

150DPI.mp4

175DPI:

175DPI.mp4

200DPI:

200DPI.mp4

225DPI:

225DPI.mp4

Test methodology

  • Manually

Test environment(s)

  • 11.0.0-alpha.1.25619.109
Microsoft Reviewers: Open in CodeFlow

Copilot AI changed the title [WIP] Fix cursor editor display issues in propertyGrid for HDPI settings Fix cursor editor ItemHeight calculation for proper DPI scaling Dec 24, 2025
Copilot AI requested a review from SimonZhao888 December 24, 2025 09:53
@codecov
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.15598%. Comparing base (05b7c2e) to head (82db747).

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14168         +/-   ##
===================================================
- Coverage   77.15877%   77.15598%   -0.00280%     
===================================================
  Files           3279        3279                 
  Lines         645333      645333                 
  Branches       47720       47720                 
===================================================
- Hits          497931      497913         -18     
- Misses        143719      143724          +5     
- Partials        3683        3696         +13     
Flag Coverage Δ
Debug 77.15598% <20.00000%> (-0.00280%) ⬇️
integration 18.98842% <0.00000%> (-0.01568%) ⬇️
production 52.02345% <20.00000%> (-0.00626%) ⬇️
test 97.40559% <ø> (ø)
unit 49.47022% <20.00000%> (+0.02777%) ⬆️

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.

@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Dec 24, 2025
@SimonZhao888 SimonZhao888 marked this pull request as ready for review December 26, 2025 05:43
@SimonZhao888 SimonZhao888 requested a review from a team as a code owner December 26, 2025 05:43
@dotnet-policy-service dotnet-policy-service bot removed the draft draft PR label Dec 26, 2025
@SimonZhao888 SimonZhao888 changed the title Fix cursor editor ItemHeight calculation for proper DPI scaling Fix cursor editor icon width calculation for proper DPI scaling Dec 26, 2025
@SimonZhao888
Copy link
Member

Here is another issue: when the DPI is set to 125%, 175%, 225%, 250%, the .cur icon exhibits an icon offset problem.
Normal:
image

Offset:
image

e.DrawBackground();
e.Graphics.FillRectangle(SystemBrushes.Control, new Rectangle(e.Bounds.X + 2, e.Bounds.Y + 2, cursorWidth, e.Bounds.Height - 4));
e.Graphics.DrawRectangle(SystemPens.WindowText, new Rectangle(e.Bounds.X + 2, e.Bounds.Y + 2, cursorWidth - 1, e.Bounds.Height - 4 - 1));
e.Graphics.FillRectangle(SystemBrushes.Control, new Rectangle(e.Bounds.X + 2, e.Bounds.Y + 2, _cursorWidth, e.Bounds.Height - 4));
Copy link
Member

Choose a reason for hiding this comment

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

The _cursorWidth variable is only used within this method, so why is it necessary to define it as a global variable and scale it in the constructor?

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.

[HDPI] Cursor editor some items are not displayed in propertyGrid with special DPI settings

3 participants