- Notifications
You must be signed in to change notification settings - Fork1.1k
[release/10.0] Refactor StatusStrip DefaultPadding calculation and adjust GripWidth for improved layout consistency#14121
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:release/10.0
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
… GripWidth for improved layout consistency (dotnet#14068)Fixesdotnet#14062 ## Proposed changes- **GripWidth Adjustment** - Changed GripWidth from 12 to 15 to improve visual balance and reduce unnecessary space.- **Refactored DefaultPadding Logic** - Previous implementation used hardcoded values: Padding(1, 0, 14, 0) or Padding(1, 3, 1, DefaultSize.Height). - New implementation dynamically calculates padding based on `SizingGripBounds.Width` and GripWidth for horizontal orientation, and adjusts for height differences in vertical orientation.- **Update unit test and add StatusStrip to DemoConsole** <!-- We are in TELL-MODE the following section must be completed -->## Customer Impact- Prevents labels and items from being pushed out of view due to fixed padding values.## Regression? - Yes
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 backports changes from PR#14068 to the release/10.0 branch, refactoring the StatusStrip's DefaultPadding calculation to be dynamic instead of hardcoded. The changes improve layout consistency and prevent items from being pushed out of view due to fixed padding values.
Key changes:
- Increased GripWidth constant from 12 to 15 pixels for better visual balance
- Refactored DefaultPadding to dynamically calculate based on SizeGripBounds dimensions
- Updated all unit and integration tests to reflect the new calculated values
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs | Core implementation: Changed GripWidth constant and refactored DefaultPadding calculation to use dynamic values based on SizeGripBounds |
| src/test/unit/System.Windows.Forms/System/Windows/Forms/StatusStripTests.cs | Updated test expectations from hardcoded padding value of 14 to dynamically calculated value of 17, and adjusted all related size calculations |
| src/test/unit/System.Windows.Forms/System/Windows/Forms/AccessibleObjects/StatusStrip.StatusStripAccessibleObjectTests.cs | Updated test data for vertical overflow sizes to account for new padding calculations, and adjusted ToolStripStatusLabel size |
| src/test/integration/DesignSurface/DemoConsole/MainForm.cs | Added StatusStrip demonstration with two labels to surface#5, increased form width from 800 to 900 to accommodate the new control |
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/StatusStrip.csShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## release/10.0 #14121 +/- ##======================================================+ Coverage 77.10691% 77.10704% +0.00012%====================================================== Files 3273 3273 Lines 645033 645041 +8 Branches 47701 47703 +2 ======================================================+ Hits 497365 497372 +7+ Misses 143989 143988 -1- Partials 3679 3681 +2
Flags with carried forward coverage won't be shown.Click here to find out more. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading.Please reload this page.
Backport#14068 to release/10.0
Fixes#14062
Proposed changes
SizingGripBounds.Widthand GripWidth for horizontal orientation, and adjusts for height differences in vertical orientation.Customer Impact
Regression?
Risk
Test methodology