[PR #8649] Fix color animation bug of title bar buttons #27265

Open
opened 2026-01-31 09:20:57 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/8649

State: closed
Merged: Yes


In dark mode (and high contrast mode), color animation of title bar
button uses wrong color. Cause of this issue is using invalid data in
ColorAnimation. I fixed this bug by changing ColorAnimation value
in XAML layout file.

According to a forum post, To value of ColorAnimation must be
frozen. But original source code uses "color binding" which makes this
value dynamic. As a result, the value set by default is always used,
that means, light mode.

So I added new resource named CaptionButtonStrokeColor and
CaptionButtonBackgroundColor which has static color value.

In light mode and dark mode, I set SystemBaseHighColor in the color
resource. SystemBaseHighColor is the same as
SystemControlForegroundBaseHighBrush.Color which is originally used in
animation.

The background color animation happened to work correctly because its
value is the same between light mode and dark mode. But I also fixed
background color animation.

Validation Steps Performed

There is no need to add new test with this fix.

  • I changed the theme value in settings.json and confirmed that the
    correct color values were used.
  • I confirmed that it works correctly even if the Windows theme is
    changed.

Closes #7314

**Original Pull Request:** https://github.com/microsoft/terminal/pull/8649 **State:** closed **Merged:** Yes --- In dark mode (and high contrast mode), color animation of title bar button uses wrong color. Cause of this issue is using invalid data in `ColorAnimation`. I fixed this bug by changing `ColorAnimation` value in XAML layout file. According to a [forum post], `To` value of `ColorAnimation` must be frozen. But original source code uses "color binding" which makes this value dynamic. As a result, the value set by default is always used, that means, light mode. So I added new resource named `CaptionButtonStrokeColor` and `CaptionButtonBackgroundColor` which has static color value. In light mode and dark mode, I set `SystemBaseHighColor` in the color resource. `SystemBaseHighColor` is the same as `SystemControlForegroundBaseHighBrush.Color` which is originally used in animation. The background color animation happened to work correctly because its value is the same between light mode and dark mode. But I also fixed background color animation. ## Validation Steps Performed There is no need to add new test with this fix. - I changed the `theme` value in `settings.json` and confirmed that the correct color values were used. - I confirmed that it works correctly even if the Windows theme is changed. [forum post]: https://social.msdn.microsoft.com/Forums/vstudio/en-US/027c364f-5d75-424f-aafd-7fb76b10b676/templatebinding-on-storyboard?forum=wpf Closes #7314
claunia added the pull-request label 2026-01-31 09:20:57 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27265