Skip to content

Commit 1caf262

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/llm
# Conflicts: # src/cascadia/TerminalApp/TerminalPage.cpp
2 parents 311fbdf + a5d916f commit 1caf262

32 files changed

+175
-509
lines changed

build/config/template.appinstaller

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
<Package
1515
Name="Microsoft.UI.Xaml.2.8"
1616
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
17-
Version="8.2305.5001.0"
17+
Version="8.2306.22001.0"
1818
ProcessorArchitecture="x64"
19-
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.4/Microsoft.UI.Xaml.2.8.x64.appx" />
19+
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.x64.appx" />
2020
<Package
2121
Name="Microsoft.UI.Xaml.2.8"
2222
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
23-
Version="8.2305.5001.0"
23+
Version="8.2306.22001.0"
2424
ProcessorArchitecture="x86"
25-
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.4/Microsoft.UI.Xaml.2.8.x86.appx" />
25+
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.x86.appx" />
2626
<Package
2727
Name="Microsoft.UI.Xaml.2.8"
2828
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
29-
Version="8.2305.5001.0"
29+
Version="8.2306.22001.0"
3030
ProcessorArchitecture="arm64"
31-
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.4/Microsoft.UI.Xaml.2.8.arm64.appx" />
31+
Uri="https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.5/Microsoft.UI.Xaml.2.8.arm64.appx" />
3232
</Dependencies>
3333

3434
<UpdateSettings>

src/cascadia/TerminalApp/ColorHelper.cpp

Lines changed: 0 additions & 267 deletions
This file was deleted.

src/cascadia/TerminalApp/ColorHelper.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/cascadia/TerminalApp/Tab.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include "SettingsPaneContent.h"
99
#include "Tab.g.cpp"
1010
#include "Utils.h"
11-
#include "ColorHelper.h"
1211
#include "AppLogic.h"
12+
#include "../../types/inc/ColorFix.hpp"
1313

1414
using namespace winrt;
1515
using namespace winrt::Windows::UI::Xaml;
@@ -2275,11 +2275,13 @@ namespace winrt::TerminalApp::implementation
22752275
// the background color
22762276
// - This method should only be called on the UI thread.
22772277
// Arguments:
2278-
// - color: the color the user picked for their tab
2278+
// - uiColor: the color the user picked for their tab
22792279
// Return Value:
22802280
// - <none>
2281-
void Tab::_ApplyTabColorOnUIThread(const winrt::Windows::UI::Color& color)
2281+
void Tab::_ApplyTabColorOnUIThread(const winrt::Windows::UI::Color& uiColor)
22822282
{
2283+
constexpr auto lightnessThreshold = 0.6f;
2284+
const til::color color{ uiColor };
22832285
Media::SolidColorBrush selectedTabBrush{};
22842286
Media::SolidColorBrush deselectedTabBrush{};
22852287
Media::SolidColorBrush fontBrush{};
@@ -2292,7 +2294,7 @@ namespace winrt::TerminalApp::implementation
22922294
// calculate the luminance of the current color and select a font
22932295
// color based on that
22942296
// see https://www.w3.org/TR/WCAG20/#relativeluminancedef
2295-
if (TerminalApp::ColorHelper::IsBrightColor(color))
2297+
if (ColorFix::GetLightness(color) >= lightnessThreshold)
22962298
{
22972299
auto subtleFillColorSecondary = winrt::Windows::UI::Colors::Black();
22982300
subtleFillColorSecondary.A = 0x09;
@@ -2312,8 +2314,8 @@ namespace winrt::TerminalApp::implementation
23122314
}
23132315

23142316
// The tab font should be based on the evaluated appearance of the tab color layered on tab row.
2315-
const auto layeredTabColor = til::color{ color }.layer_over(_tabRowColor);
2316-
if (TerminalApp::ColorHelper::IsBrightColor(layeredTabColor))
2317+
const auto layeredTabColor = color.layer_over(_tabRowColor);
2318+
if (ColorFix::GetLightness(layeredTabColor) >= lightnessThreshold)
23172319
{
23182320
fontBrush.Color(winrt::Windows::UI::Colors::Black());
23192321
auto secondaryFontColor = winrt::Windows::UI::Colors::Black();
@@ -2333,8 +2335,7 @@ namespace winrt::TerminalApp::implementation
23332335
selectedTabBrush.Color(color);
23342336

23352337
// Start with the current tab color, set to Opacity=.3
2336-
til::color deselectedTabColor{ color };
2337-
deselectedTabColor = deselectedTabColor.with_alpha(77); // 255 * .3 = 77
2338+
auto deselectedTabColor = color.with_alpha(77); // 255 * .3 = 77
23382339

23392340
// If we DON'T have a color set from the color picker, or the profile's
23402341
// tabColor, but we do have a unfocused color in the theme, use the
@@ -2376,7 +2377,7 @@ namespace winrt::TerminalApp::implementation
23762377
// We don't want that to result in white text on a white tab row for
23772378
// inactive tabs.
23782379
const auto deselectedActualColor = deselectedTabColor.layer_over(_tabRowColor);
2379-
if (TerminalApp::ColorHelper::IsBrightColor(deselectedActualColor))
2380+
if (ColorFix::GetLightness(deselectedActualColor) >= lightnessThreshold)
23802381
{
23812382
deselectedFontBrush.Color(winrt::Windows::UI::Colors::Black());
23822383
}

0 commit comments

Comments
 (0)