Skip to content

feat: add MicaAlt support for settings background (#17650) #19055

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,12 @@
"type": "boolean",
"default": false
},
"useMicaAlt": {
"description": "Enable the MicaAlt visual effect.",
"type": "boolean",
"default": false
},

"experimental.rainbowFrame": {
"description": "When enabled, the frame of the window will cycle through all the colors. Enabling this will override the `frame` and `unfocusedFrame` settings.",
"type": "boolean",
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalSettingsEditor/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
// that our theme is different than the app's.
const bool actuallyUseMica = isMicaAvailable && (appTheme == requestedTheme);

const auto bgKey = (theme.Window() != nullptr && theme.Window().UseMica()) && actuallyUseMica ?
const auto bgKey = (theme.Window() != nullptr && theme.Window().UseMica()) || UseMicaAlt() && actuallyUseMica ?
L"SettingsPageMicaBackground" :
L"SettingsPageBackground";

Expand Down
13 changes: 13 additions & 0 deletions src/cascadia/TerminalSettingsModel/GlobalAppSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ static constexpr std::string_view LegacyConfirmCloseAllTabsKey{ "confirmCloseAll
// - <none>
// Return Value:
// - <none>

bool _useMicaAlt = false;

bool GlobalAppSettings::UseMicaAlt() const
{
return _useMicaAlt;
}
void GlobalAppSettings::_FinalizeInheritance()
{
for (const auto& parent : _parents)
Expand Down Expand Up @@ -208,6 +215,12 @@ void GlobalAppSettings::LayerJson(const Json::Value& json, const OriginTag origi
}
}
}

if (json.isMember("useMicaAlt"))
{
JsonUtils::GetValueForKey(json, "useMicaAlt", _useMicaAlt);
}

}

void GlobalAppSettings::LayerActionsFrom(const Json::Value& json, const OriginTag origin, const bool withKeybindings)
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalSettingsModel/GlobalAppSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Author(s):
#include "NewTabMenuEntry.h"
#include "RemainingProfilesEntry.h"

bool UseMicaAlt() const;
bool _useMicaAlt = false;

// fwdecl unittest classes
namespace SettingsModelUnitTests
{
Expand Down
Loading