[PR #19668] Add caption button dim out for unfocused windows #31917

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

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

State: closed
Merged: Yes


Summary of the Pull Request

This PR closes #12632 by dimming the caption controls in the titlebar when unfocused. Leaves them intact when in high contrast mode. The color used is borrowed from PowerToy's unfocused color: 37bd24db36/src/settings-ui/Settings.UI/SettingsXAML/Controls/TitleBar/TitleBar.xaml (L179)

References and Relevant Issues

https://github.com/microsoft/terminal/issues/12632
https://github.com/microsoft/terminal/pull/10401

Detailed Description of the Pull Request / Additional comments

Introduces a _focused boolean to TitlebarControl which is passed into MinMaxCloseControl. Instead of using a new VisualStateGroup, I opted to slot the Unfocused state into CommonStates, this way we prevent any conflicts with Visual Setters, and can preserve animations.

Validation Steps Performed

Tested by hovering and unhovering in focused and unfocused states, as well as in high contrast mode. States are consistent and applied correctly. I did notice that clicking on the titlebar wouldn't put it into focus unless I also moved my mouse though, but that is also present in the release branch.

Closes #12632

**Original Pull Request:** https://github.com/microsoft/terminal/pull/19668 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This PR closes #12632 by dimming the caption controls in the titlebar when unfocused. Leaves them intact when in high contrast mode. The color used is borrowed from PowerToy's unfocused color: https://github.com/microsoft/PowerToys/blob/37bd24db365d7bfc3e27fc77d0ac3c0948ffa189/src/settings-ui/Settings.UI/SettingsXAML/Controls/TitleBar/TitleBar.xaml#L179 ## References and Relevant Issues https://github.com/microsoft/terminal/issues/12632 https://github.com/microsoft/terminal/pull/10401 ## Detailed Description of the Pull Request / Additional comments Introduces a `_focused` boolean to `TitlebarControl` which is passed into `MinMaxCloseControl`. Instead of using a new VisualStateGroup, I opted to slot the Unfocused state into CommonStates, this way we prevent any conflicts with Visual Setters, and can preserve animations. ## Validation Steps Performed Tested by hovering and unhovering in focused and unfocused states, as well as in high contrast mode. States are consistent and applied correctly. I did notice that clicking on the titlebar wouldn't put it into focus unless I also moved my mouse though, but that is also present in the release branch. Closes #12632
claunia added the pull-request label 2026-01-31 09:50:23 +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#31917