Skip to content

Commit 0b492ab

Browse files
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
1 parent 86a6245 commit 0b492ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cascadia/TerminalApp/TabBase.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,9 @@ namespace winrt::TerminalApp::implementation
528528
tabItemThemeResources.Insert(winrt::box_value(L"Dark"), darkThemeDictionary);
529529
tabItemThemeResources.Insert(winrt::box_value(L"HighContrast"), highContrastThemeDictionary);
530530

531+
// Apply the color to the tab
532+
TabViewItem().Background(deselectedTabBrush);
533+
531534
// Now actually set the resources we want in them.
532535
// Before, we used to put these on the ResourceDictionary directly.
533536
// However, HighContrast mode may require some adjustments. So let's just add
@@ -560,7 +563,6 @@ namespace winrt::TerminalApp::implementation
560563
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderSelectedCloseButtonForeground"), fontBrush);
561564

562565
// TabViewItem.CloseButton.Background (aka X button)
563-
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackground"), deselectedTabBrush);
564566
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPressed"), isHighContrast ? selectedTabBrush : subtleFillColorTertiaryBrush);
565567
currentDictionary.Insert(winrt::box_value(L"TabViewItemHeaderCloseButtonBackgroundPointerOver"), isHighContrast ? selectedTabBrush : subtleFillColorSecondaryBrush);
566568

0 commit comments

Comments
 (0)