-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix 14062: Exclude sizing grip width from DisplayRectangle when SizingGrip is enabled #14068
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
base: main
Are you sure you want to change the base?
Fix 14062: Exclude sizing grip width from DisplayRectangle when SizingGrip is enabled #14068
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes issue #14062 by overriding the DisplayRectangle property in StatusStrip to properly exclude the sizing grip width when SizingGrip is enabled. This prevents ToolStripStatusLabel items from overlapping with or being truncated by the grip, especially when using Spring = true.
Key changes:
- Override
DisplayRectangleproperty to reduce available space by the DPI-scaled grip width whenSizingGripis enabled - Handle RTL layouts by adjusting both X position and width for right-to-left, or just width for left-to-right
- Document the new public API surface in PublicAPI.Unshipped.txt
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| StatusStrip.cs | Adds DisplayRectangle property override to exclude sizing grip width from layout space when SizingGrip is enabled, with proper DPI scaling and RTL handling |
| PublicAPI.Unshipped.txt | Documents the new public API surface for the DisplayRectangle override |
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14068 +/- ##
===================================================
+ Coverage 77.15882% 77.16237% +0.00354%
===================================================
Files 3279 3279
Lines 645317 645334 +17
Branches 47718 47721 +3
===================================================
+ Hits 497919 497955 +36
+ Misses 143711 143690 -21
- Partials 3687 3689 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
ricardobossan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM!
7f3332b
…e area of intersection between an item and a SizingGrip exceeds a certain threshold (e.g., >50%).
Fixes #14062
Proposed changes
StatusStrip.DisplayRectangleWhenSizingGrip == true:ScaleHelper.ScaleToDpi(GripWidth, DeviceDpi).RightToLeft == Yes, subtract width from the left and shift rect.X to the right by the grip width.RightToLeft == No, subtract width from the right side.Customer Impact
Regression?
Risk
Screenshots
Before
The right label is missing when the first ToolStripStatusLabel has Spring = True
After
The right-side label is displayed in full.
AfterChange.mp4
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow