mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 13:56:33 -06:00
Fix colored tab losing color when unselected (#18306)
If we colored a tab, then switched to another tab, there's a bug that the unselected tab loses its color. This was introduced in PR #18109. This PR fixes that by actually applying the selected color to the tab (whoops). Additionally, I removed setting the "TabViewItemHeaderCloseButtonBackground" resource because it looked weird (see comment in PR). Closes #18226
This commit is contained in:
parent
86a624517e
commit
0b492aba51
@ -528,6 +528,9 @@ namespace winrt::TerminalApp::implementation
|
|||||||
tabItemThemeResources.Insert(winrt::box_value(L"Dark"), darkThemeDictionary);
|
tabItemThemeResources.Insert(winrt::box_value(L"Dark"), darkThemeDictionary);
|
||||||
tabItemThemeResources.Insert(winrt::box_value(L"HighContrast"), highContrastThemeDictionary);
|
tabItemThemeResources.Insert(winrt::box_value(L"HighContrast"), highContrastThemeDictionary);
|
||||||
|
|
||||||
|
// Apply the color to the tab
|
||||||
|
TabViewItem().Background(deselectedTabBrush);
|
||||||
|
|
||||||
// Now actually set the resources we want in them.
|
// Now actually set the resources we want in them.
|
||||||
// Before, we used to put these on the ResourceDictionary directly.
|
// Before, we used to put these on the ResourceDictionary directly.
|
||||||
// However, HighContrast mode may require some adjustments. So let's just add
|
// However, HighContrast mode may require some adjustments. So let's just add
|
||||||
@ -560,7 +563,6 @@ namespace winrt::TerminalApp::implementation
|
|||||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderSelectedCloseButtonForeground"), fontBrush);
|
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderSelectedCloseButtonForeground"), fontBrush);
|
||||||
|
|
||||||
// TabViewItem.CloseButton.Background (aka X button)
|
// TabViewItem.CloseButton.Background (aka X button)
|
||||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackground"), deselectedTabBrush);
|
|
||||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPressed"), isHighContrast ? selectedTabBrush : subtleFillColorTertiaryBrush);
|
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPressed"), isHighContrast ? selectedTabBrush : subtleFillColorTertiaryBrush);
|
||||||
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPointerOver"), isHighContrast ? selectedTabBrush : subtleFillColorSecondaryBrush);
|
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPointerOver"), isHighContrast ? selectedTabBrush : subtleFillColorSecondaryBrush);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user