Skip to content

Revert "Fix GroupBox Standard and Popup layout overlap when switching to NET11 visual styles (#14891)" - #15069

Merged
LeafShi1 merged 2 commits into
dotnet:mainfrom
LeafShi1:Restore_changes_on_GroupBox_layout
Sep 10, 2026
Merged

LeafShi1 merged 2 commits into
dotnet:mainfrom
LeafShi1:Restore_changes_on_GroupBox_layout

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

This reverts commit 69aa55b

Before changes:
image

After Changes:
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There’s at least one concrete fixable issue (avoidable InstalledFontCollection creation in Semibold lookup) and the PR description should be updated to accurately reflect the behavioral changes included.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Reverts a prior GroupBox modern-visual-styles change and updates the modern renderer’s layout/rendering metrics, caption font behavior, and related tests/docs to match the reverted (or re-established) behavior.

Changes:

  • Adjust modern GroupBox layout insets for Standard/Popup/Flat, including Popup header sizing and caption positioning.
  • Update modern caption font behavior (scale factor for non-Flat, optional installed Semibold face selection) and text-scale layout remeasurement.
  • Align unit tests and XML docs with the updated modern renderer behavior.
File summaries
File Description
src/test/unit/System.Windows.Forms/System/Windows/Forms/GroupBoxTests.cs Updates renderer/layout tests to match new Standard/Popup metrics, caption font behavior, and layout invalidation expectations.
src/System.Windows.Forms/System/Windows/Forms/Rendering/ModernControlVisualStyles.cs Adds modern GroupBox metric constants (caption scale, insets/padding).
src/System.Windows.Forms/System/Windows/Forms/Controls/GroupBox/GroupBox.Modern.cs Revises modern padding calculations and popup rendering; adds Semibold face lookup + caching; changes text-scale relayout behavior.
src/System.Windows.Forms/System/Windows/Forms/Controls/GroupBox/GroupBox.FlatStyle.Docs.cs Updates docs to describe the modern visual appearance and layout behavior changes.
src/System.Windows.Forms/System/Windows/Forms/Controls/GroupBox/GroupBox.cs Refactors classic DisplayRectangle calculation to inline font-height caching logic.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.24166%. Comparing base (bde2c6b) to head (380509c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##                main      #15069   +/-   ##
=============================================
  Coverage   37.24166%   37.24166%           
=============================================
  Files            246         246           
  Lines           9774        9774           
  Branches        1029        1029           
=============================================
  Hits            3640        3640           
  Misses          5970        5970           
  Partials         164         164           
Flag Coverage Δ
Debug 37.24166% <ø> (ø)
production 39.36526% <ø> (ø)
test 20.64923% <ø> (ø)
unit 39.36526% <ø> (ø)

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.

@KlausLoeffelmann KlausLoeffelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, looks good!
Please merge it as soon as you got a minute, so I can update my local main, and see, if I want tweak the caption-size a bit down.

Thanks!

@LeafShi1
LeafShi1 merged commit e5747cd into dotnet:main Sep 10, 2026
8 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 11, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants