Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Fix 15389: [Suggestion] Shorten ToggleSwitch state-transition animations - #15390

Merged
KlausLoeffelmann merged 1 commit into
dotnet:mainfrom
SimonZhao888:Fix_Issue_15389
Nov 16, 2026
Merged

KlausLoeffelmann merged 1 commit into
dotnet:mainfrom
SimonZhao888:Fix_Issue_15389

Conversation

@SimonZhao888

@SimonZhao888 SimonZhao888 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Fixes #15389

Proposed changes

  • Reduce AnimatedToggleSwitchRenderer.AnimationDuration from 300 ms to 150 ms.
  • Reduce AnimatedCheckGlyphRenderer.AnimationDuration from 220 ms to 150 ms.
  • Reduce AnimatedRadioGlyphRenderer.AnimationDuration from 200 ms to 150 ms.
  • Reduce ButtonBackColorAnimator.AnimationDuration from 350 ms to 200 ms.

Customer Impact

Applications using these renderers will display shorter ToggleSwitch transitions, CheckBox and RadioButton glyph animations, and button background-color transitions, making visual feedback feel more immediate.

No application code changes are required. The changes affect visual animation timing only; control layout, sizing, logical checked-state behavior, and event semantics remain unchanged.

Regression?

  • No

Risk

  • Mini

Screenshots

Before

Before.mp4

After

After.mp4

Test methodology

  • Manual

Test environment(s)

  • 11.0.100-rc.2.26509.113
Microsoft Reviewers: Open in CodeFlow

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.

🟢 Approval recommended

No active review issues are reported for the change reducing ToggleSwitch animation duration from 300 ms to 150 ms.

No open issues 🎉

What changed in this PR

Addresses #15389 by shortening animations for CheckBox and RadioButton controls using ToggleSwitch appearance, providing faster visual feedback.

Changes:

  • Reduces the shared animation duration from 300 ms to 150 ms, affecting state, hover, and focus transitions without changing animation logic.
File Description
src/​System.Windows.Forms/​System/​Windows/​Forms/​Rendering/​CheckBox/​AnimatedToggleSwitchRenderer.cs Halves the ToggleSwitch animation duration to 150 ms.

Review effort: Balanced

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.79260%. Comparing base (8a95231) to head (aec88f6).

Additional details and impacted files
@@              Coverage Diff              @@
##                main      #15390   +/-   ##
=============================================
  Coverage   39.79260%   39.79260%           
=============================================
  Files            246         246           
  Lines           9836        9836           
  Branches        1036        1036           
=============================================
  Hits            3914        3914           
  Misses          5741        5741           
  Partials         181         181           
Flag Coverage Δ
Debug 39.79260% <ø> (ø)
production 42.31695% <ø> (ø)
test 19.92786% <ø> (ø)
unit 42.31695% <ø> (ø)

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.

@LeafShi1 LeafShi1 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.

LGTM!

@SimonZhao888 SimonZhao888 added the waiting-review This item is waiting on review by one or more members of team label Nov 10, 2026

@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.

We should try to get this in for patching today, also...
This is an A11Y issue, particularly the long Button transition.

@KlausLoeffelmann
KlausLoeffelmann merged commit 30ab8ee into dotnet:main Nov 16, 2026
8 checks passed
@dotnet-policy-service dotnet-policy-service Bot removed the waiting-review This item is waiting on review by one or more members of team label Nov 16, 2026
@LeafShi1

Copy link
Copy Markdown
Member

We should try to get this in for patching today, also... This is an A11Y issue, particularly the long Button transition.

This is already included in #15386

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 17, 2026
LeafShi1 added a commit that referenced this pull request Dec 3, 2026
…5386)

## Description

Backports seven WinForms fixes from main to release/11.0 for inclusion
in the December 2026 .NET 11 servicing release.
These changes address several issues affecting control rendering,
layout, DPI scaling, selection handling, and native resource management.

## Fixes

- #15325
- #15212
- #15361
- #15270
- #15207
- #15254
- #15390

##  Proposed Changes

This PR cherry-picks the following fixes:

1. **UpDown sizing and focus indicator (#15325)**
- Fixes sizing issues and focus-indicator flickering in UpDown controls
when using .NET 11 visual styles.
2. **DomainUpDown and NumericUpDown height (#15212)**
- Fixes an issue where these controls incorrectly allow height changes
instead of preserving their expected height in VisualStylesMode.Net11.
3. **ListBox selection handling (#15361)**
- Fixes an IndexOutOfRangeException in ListBox.RefreshItems caused by a
stale selected-item count cache.
4. **ToggleSwitch checked thumb color (#15270)**
   - Corrects the checked thumb color in both light and dark modes.
5. **UpDown DPI scaling (#15207)**
   - Fixes incorrect scaling of UpDown buttons when DPI changes.
6. **Bitmap native memory leak (#15254)**
- Fixes a native GDI+ memory leak when a Bitmap is finalized during
Image.Save(Stream, ImageFormat).
7. **ToggleSwitch animation improvements**
- Shortens ToggleSwitch state-transition animations to improve
responsiveness.

## Customer Impact

These fixes address issues that can affect applications running on .NET
11:

- **Visual and layout issues:** Incorrect control sizing,
focus-indicator flickering, and inconsistent ToggleSwitch rendering can
negatively affect the user experience.
- **High-DPI environments:** UpDown buttons may scale incorrectly when
applications move between displays with different DPI settings.
- **Application reliability:** The ListBox issue can cause an
IndexOutOfRangeException during item refresh operations.
- **Resource management:** The Bitmap issue can cause native GDI+ memory
to remain allocated after the affected save operation.

The changes improve control rendering, layout consistency, DPI scaling,
and application reliability. Existing applications will receive the
fixes without requiring code changes. Some visual and behavioral
differences may be noticeable in affected controls, particularly those
using .NET 11 visual styles.

## Regression?

**Partially.**

Several fixes address issues associated with the new .NET 11 visual
styles, particularly control sizing, focus indicators, and ToggleSwitch
rendering.
The remaining fixes address functional correctness, DPI scaling, and
native resource management issues.
Not all seven issues have been confirmed as regressions introduced in
.NET 11.

## Testing
All seven included fixes have been validated.

- Verified the fixes for all seven cherry-picked PRs.
- Confirmed that the corresponding GitHub issues are resolved.
- No new regression issues were identified during validation.

## Risk

**Minimal**

- These changes have already been merged into main.
- All seven fixes have been individually validated.
- No new regressions were identified during testing.
- Most changes are targeted fixes for specific control behaviors.
- The ListBox and Bitmap fixes affect functional behavior and native
resource management, therefore, additional regression tests have been
added.
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.

[Suggestion] Shorten ToggleSwitch state-transition animations

4 participants