Skip to content

Conversation

@LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Dec 9, 2025

Backport #14068 to release/10.0

Fixes #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 in DemoConsole

Customer Impact

  • Prevents labels and items from being pushed out of view due to fixed padding values.

Regression?

Risk

  • Low

Test methodology

  • Manual testing
  • Unit tests

… GripWidth for improved layout consistency (dotnet#14068)

Fixes dotnet#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
Copy link
Contributor

Copilot AI left a 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

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 97.77778% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 77.10704%. Comparing base (bb08309) to head (07e87c6).

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     
Flag Coverage Δ
Debug 77.10704% <97.77778%> (+0.00012%) ⬆️
integration 18.97578% <0.00000%> (-0.00540%) ⬇️
production 51.92748% <90.00000%> (+0.00098%) ⬆️
test 97.40998% <100.00000%> (ø)
unit 49.34639% <90.00000%> (+0.00140%) ⬆️

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant