mirror of
https://github.com/microsoft/terminal.git
synced 2026-02-09 05:35:08 +00:00
Add "legacy" themes (#15108)
This is a minimal version of the requests for #14858. In that thread we discussed FULL reverting the default themes to the old ones. In later discussion, we decided _meh_, let's just ship the legacy themes too, so it's easy to go back if you should choose. The default still remains the sane `dark`, but the `legacy*` themes are all right there, and given the same special treatment as the other inbox themes. Closes #14858 Closes #14844
This commit is contained in:
@@ -43,6 +43,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
constexpr std::wstring_view systemThemeName{ L"system" };
|
||||
constexpr std::wstring_view darkThemeName{ L"dark" };
|
||||
constexpr std::wstring_view lightThemeName{ L"light" };
|
||||
constexpr std::wstring_view legacySystemThemeName{ L"legacySystem" };
|
||||
constexpr std::wstring_view legacyDarkThemeName{ L"legacyDark" };
|
||||
constexpr std::wstring_view legacyLightThemeName{ L"legacyLight" };
|
||||
|
||||
GlobalAppearanceViewModel::GlobalAppearanceViewModel(Model::GlobalAppSettings globalSettings) :
|
||||
_GlobalSettings{ globalSettings },
|
||||
@@ -248,6 +251,18 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
||||
{
|
||||
return RS_(L"Globals_ThemeSystem/Content");
|
||||
}
|
||||
else if (theme.Name() == legacyDarkThemeName)
|
||||
{
|
||||
return RS_(L"Globals_ThemeDarkLegacy/Content");
|
||||
}
|
||||
else if (theme.Name() == legacyLightThemeName)
|
||||
{
|
||||
return RS_(L"Globals_ThemeLightLegacy/Content");
|
||||
}
|
||||
else if (theme.Name() == legacySystemThemeName)
|
||||
{
|
||||
return RS_(L"Globals_ThemeSystemLegacy/Content");
|
||||
}
|
||||
return theme.Name();
|
||||
}
|
||||
|
||||
|
||||
@@ -536,15 +536,27 @@
|
||||
</data>
|
||||
<data name="Globals_ThemeDark.Content" xml:space="preserve">
|
||||
<value>Dark</value>
|
||||
<comment>An option to choose from for the "tab width mode" setting. When selected, the app is in dark theme and darker colors are used throughout the app.</comment>
|
||||
<comment>An option to choose from for the "theme" setting. When selected, the app is in dark theme and darker colors are used throughout the app.</comment>
|
||||
</data>
|
||||
<data name="Globals_ThemeSystem.Content" xml:space="preserve">
|
||||
<value>Use Windows theme</value>
|
||||
<comment>An option to choose from for the "tab width mode" setting. When selected, the app uses the theme selected in the Windows operating system.</comment>
|
||||
<comment>An option to choose from for the "theme" setting. When selected, the app uses the theme selected in the Windows operating system.</comment>
|
||||
</data>
|
||||
<data name="Globals_ThemeLight.Content" xml:space="preserve">
|
||||
<value>Light</value>
|
||||
<comment>An option to choose from for the "tab width mode" setting. When selected, the app is in light theme and lighter colors are used throughout the app.</comment>
|
||||
<comment>An option to choose from for the "theme" setting. When selected, the app is in light theme and lighter colors are used throughout the app.</comment>
|
||||
</data>
|
||||
<data name="Globals_ThemeDarkLegacy.Content" xml:space="preserve">
|
||||
<value>Dark (Legacy)</value>
|
||||
<comment>An option to choose from for the "theme" setting. When selected, the app is in dark theme and darker colors are used throughout the app. This is an older version of the "dark" theme</comment>
|
||||
</data>
|
||||
<data name="Globals_ThemeSystemLegacy.Content" xml:space="preserve">
|
||||
<value>Use Windows theme (Legacy)</value>
|
||||
<comment>An option to choose from for the "theme" setting. When selected, the app uses the theme selected in the Windows operating system. This is an older version of the "Use Windows theme" theme</comment>
|
||||
</data>
|
||||
<data name="Globals_ThemeLightLegacy.Content" xml:space="preserve">
|
||||
<value>Light (Legacy)</value>
|
||||
<comment>An option to choose from for the "theme" setting. When selected, the app is in light theme and lighter colors are used throughout the app. This is an older version of the "light" theme</comment>
|
||||
</data>
|
||||
<data name="Globals_WordDelimiters.Header" xml:space="preserve">
|
||||
<value>Word delimiters</value>
|
||||
|
||||
@@ -52,6 +52,9 @@ static constexpr std::string_view ThemesKey{ "themes" };
|
||||
constexpr std::wstring_view systemThemeName{ L"system" };
|
||||
constexpr std::wstring_view darkThemeName{ L"dark" };
|
||||
constexpr std::wstring_view lightThemeName{ L"light" };
|
||||
constexpr std::wstring_view legacySystemThemeName{ L"legacySystem" };
|
||||
constexpr std::wstring_view legacyDarkThemeName{ L"legacyDark" };
|
||||
constexpr std::wstring_view legacyLightThemeName{ L"legacyLight" };
|
||||
|
||||
static constexpr std::wstring_view jsonExtension{ L".json" };
|
||||
static constexpr std::wstring_view FragmentsSubDirectory{ L"\\Fragments" };
|
||||
@@ -562,8 +565,9 @@ void SettingsLoader::_parse(const OriginTag origin, const winrt::hstring& source
|
||||
{
|
||||
if (const auto theme = Theme::FromJson(themeJson))
|
||||
{
|
||||
const auto& name{ theme->Name() };
|
||||
if (origin != OriginTag::InBox &&
|
||||
(theme->Name() == systemThemeName || theme->Name() == lightThemeName || theme->Name() == darkThemeName))
|
||||
(name == systemThemeName || name == lightThemeName || name == darkThemeName || name == legacySystemThemeName || name == legacyDarkThemeName || name == legacyLightThemeName))
|
||||
{
|
||||
// If the theme didn't come from the in-box themes, and its
|
||||
// name was one of the reserved names, then just ignore it.
|
||||
@@ -953,10 +957,16 @@ void CascadiaSettings::_researchOnLoad()
|
||||
// light: 1
|
||||
// dark: 2
|
||||
// a custom theme: 3
|
||||
const auto themeChoice = themeInUse == L"system" ? 0 :
|
||||
themeInUse == L"light" ? 1 :
|
||||
themeInUse == L"dark" ? 2 :
|
||||
3;
|
||||
// system (legacy): 4
|
||||
// light (legacy): 5
|
||||
// dark (legacy): 6
|
||||
const auto themeChoice = themeInUse == L"system" ? 0 :
|
||||
themeInUse == L"light" ? 1 :
|
||||
themeInUse == L"dark" ? 2 :
|
||||
themeInUse == L"legacyDark" ? 4 :
|
||||
themeInUse == L"legacyLight" ? 5 :
|
||||
themeInUse == L"legacySystem" ? 6 :
|
||||
3;
|
||||
|
||||
TraceLoggingWrite(
|
||||
g_hSettingsModelProvider,
|
||||
|
||||
@@ -316,6 +316,36 @@
|
||||
"background": "terminalBackground",
|
||||
"unfocusedBackground": "#00000000"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "legacyDark",
|
||||
"tab": {
|
||||
"background": null,
|
||||
"unfocusedBackground": null
|
||||
},
|
||||
"window": {
|
||||
"applicationTheme": "dark"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "legacyLight",
|
||||
"tab": {
|
||||
"background": null,
|
||||
"unfocusedBackground": null
|
||||
},
|
||||
"window": {
|
||||
"applicationTheme": "light"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "legacySystem",
|
||||
"tab": {
|
||||
"background": null,
|
||||
"unfocusedBackground": null
|
||||
},
|
||||
"window": {
|
||||
"applicationTheme": "system"
|
||||
},
|
||||
}
|
||||
],
|
||||
"actions":
|
||||
|
||||
Reference in New Issue
Block a user