Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the default themes for 1.16 #13743

Merged
merged 33 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
57e02b8
sometimes I do the code good
zadjii-msft Aug 5, 2022
fe5a86d
Merge remote-tracking branch 'origin/main' into dev/migrie/b/13684-in…
zadjii-msft Aug 11, 2022
bdfb015
Allow the settings tab to also have a color set by the theme
zadjii-msft Aug 11, 2022
4146d71
default settings changes
zadjii-msft Aug 11, 2022
f911929
transparent inactive tabs on light tab row, when the tabs have a dark…
zadjii-msft Aug 11, 2022
2964ebe
comments
zadjii-msft Aug 11, 2022
37ce107
I can't tell you how much I hate this
zadjii-msft Aug 11, 2022
25e09d6
comments galore
zadjii-msft Aug 11, 2022
b38b704
Merge branch 'dev/migrie/b/13554-new-default-theme' into dev/migrie/b…
zadjii-msft Aug 12, 2022
48deba0
Revert the changes I made to the default themes
zadjii-msft Aug 12, 2022
ff90631
runformat
zadjii-msft Aug 12, 2022
dfe40fa
Merge remote-tracking branch 'origin/main' into dev/migrie/b/13684-in…
zadjii-msft Aug 15, 2022
b040192
Thanks austin mode
zadjii-msft Aug 15, 2022
eae495c
Merge branch 'dev/migrie/b/13684-inactiveTabBg' into dev/migrie/b/135…
zadjii-msft Aug 15, 2022
dd218d1
Revert "Revert the changes I made to the default themes"
zadjii-msft Aug 15, 2022
17262f7
Merge remote-tracking branch 'origin/main' into dev/migrie/b/13684-in…
zadjii-msft Aug 18, 2022
60d28f3
Merge remote-tracking branch 'origin/main' into dev/migrie/b/13684-in…
zadjii-msft Aug 24, 2022
4c7cfee
Merge branch 'main' into dev/migrie/b/13684-inactiveTabBg
zadjii-msft Aug 25, 2022
250ca8c
Merge branch 'dev/migrie/b/13684-inactiveTabBg' into dev/migrie/b/135…
zadjii-msft Aug 25, 2022
6727b5f
fixes the settings tab getting initialized with the wrong theme
zadjii-msft Aug 26, 2022
8ecbc6e
This fixes the unfocused tab color weirdness
zadjii-msft Aug 26, 2022
9f7cbdc
fixes the settings tab getting initialized with the wrong theme
zadjii-msft Aug 26, 2022
c5e0445
This fixes the unfocused tab color weirdness
zadjii-msft Aug 26, 2022
27e826e
Merge branch 'dev/migrie/b/13684-inactiveTabBg' into dev/migrie/b/135…
zadjii-msft Aug 26, 2022
2e8e802
Merge remote-tracking branch 'origin/main' into dev/migrie/b/13684-in…
zadjii-msft Aug 29, 2022
da56d48
Merge remote-tracking branch 'origin/main' into dev/migrie/b/13684-in…
zadjii-msft Aug 30, 2022
951ab2c
nits from review
zadjii-msft Aug 30, 2022
b92da58
okay
zadjii-msft Aug 30, 2022
8cafe8a
Merge branch 'dev/migrie/b/13684-inactiveTabBg' into dev/migrie/b/135…
zadjii-msft Aug 30, 2022
81ef597
Update src/inc/til/color.h
zadjii-msft Aug 31, 2022
ec3ebb9
ugh "aai is not a word"
zadjii-msft Aug 31, 2022
707ea09
Merge branch 'dev/migrie/b/13684-inactiveTabBg' into dev/migrie/b/135…
zadjii-msft Aug 31, 2022
2b54363
I think this is the format they wanted?
zadjii-msft Aug 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/cascadia/TerminalApp/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,13 @@
See GH #12356 for more history on the subject.
-->
<SolidColorBrush x:Key="TabViewBackground"
Color="#0a0a0a" />
Color="#2e2e2e" />

<StaticResource x:Key="UnfocusedBorderBrush"
ResourceKey="ApplicationPageBackgroundThemeBrush" />

<SolidColorBrush x:Key="SettingsUiTabBrush"
Color="#0c0c0c" />
</ResourceDictionary>

<ResourceDictionary x:Key="Light">
Expand All @@ -162,10 +165,13 @@
GH #12398 has more history on this value, as well as GH #12400
-->
<SolidColorBrush x:Key="TabViewBackground"
Color="#dadada" />
Color="#e8e8e8" />

<StaticResource x:Key="UnfocusedBorderBrush"
ResourceKey="ApplicationPageBackgroundThemeBrush" />

<SolidColorBrush x:Key="SettingsUiTabBrush"
Color="#ffffff" />
</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast">
Expand All @@ -183,6 +189,9 @@
-->
<StaticResource x:Key="TabViewBackground"
ResourceKey="SystemColorButtonFaceColorBrush" />

<StaticResource x:Key="SettingsUiTabBrush"
ResourceKey="SystemControlBackgroundBaseLowBrush" />
</ResourceDictionary>

</ResourceDictionary.ThemeDictionaries>
Expand Down
20 changes: 19 additions & 1 deletion src/cascadia/TerminalApp/SettingsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ namespace winrt

namespace winrt::TerminalApp::implementation
{
SettingsTab::SettingsTab(MainPage settingsUI)
SettingsTab::SettingsTab(MainPage settingsUI,
winrt::Windows::UI::Xaml::ElementTheme requestedTheme)
{
Content(settingsUI);
_requestedTheme = requestedTheme;

_MakeTabViewItem();
_CreateContextMenu();
Expand All @@ -36,6 +38,10 @@ namespace winrt::TerminalApp::implementation
{
auto settingsUI{ Content().as<MainPage>() };
settingsUI.UpdateSettings(settings);

// Stash away the current requested theme of the app. We'll need that in
// _BackgroundBrush() to do a theme-aware resource lookup
_requestedTheme = settings.GlobalSettings().CurrentTheme().RequestedTheme();
}

// Method Description:
Expand Down Expand Up @@ -105,4 +111,16 @@ namespace winrt::TerminalApp::implementation
TabViewItem().IconSource(IconPathConverter::IconSourceMUX(glyph));
}
}

winrt::Windows::UI::Xaml::Media::Brush SettingsTab::_BackgroundBrush()
{
// Look up the color we should use for the settings tab item from our
// resources. This should only be used for when "terminalBackground" is
// requested.
static const auto key = winrt::box_value(L"SettingsUiTabBrush");
// You can't just do a Application::Current().Resources().TryLookup
// lookup, cause the app theme never changes! Do the hacky version
// instead.
return ThemeLookup(Application::Current().Resources(), _requestedTheme, key).try_as<winrt::Windows::UI::Xaml::Media::Brush>();
}
}
7 changes: 6 additions & 1 deletion src/cascadia/TerminalApp/SettingsTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,20 @@ namespace winrt::TerminalApp::implementation
struct SettingsTab : SettingsTabT<SettingsTab, TabBase>
{
public:
SettingsTab(winrt::Microsoft::Terminal::Settings::Editor::MainPage settingsUI);
SettingsTab(winrt::Microsoft::Terminal::Settings::Editor::MainPage settingsUI,
winrt::Windows::UI::Xaml::ElementTheme requestedTheme);

void UpdateSettings(Microsoft::Terminal::Settings::Model::CascadiaSettings settings);
void Focus(winrt::Windows::UI::Xaml::FocusState focusState) override;

std::vector<Microsoft::Terminal::Settings::Model::ActionAndArgs> BuildStartupActions() const override;

private:
winrt::Windows::UI::Xaml::ElementTheme _requestedTheme;

void _MakeTabViewItem() override;
winrt::fire_and_forget _CreateIcon();

virtual winrt::Windows::UI::Xaml::Media::Brush _BackgroundBrush() override;
};
}
Loading