Skip to content

Commit

Permalink
优化菜单动画
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTaleX531 committed Aug 6, 2023
1 parent 34591f0 commit d5e725b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions TFMain/MenuAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,28 @@ namespace TranslucentFlyouts::MenuAnimation
)
{
SetClassLongPtr(window, GCL_STYLE, GetClassLongPtr(window, GCL_STYLE) | (CS_DROPSHADOW | CS_SAVEBITS));

DWORD effectType
{
RegHelper::GetDword(
L"Menu",
L"EffectType",
static_cast<DWORD>(EffectHelper::EffectType::ModernAcrylicBlur)
)
};
if (
RegHelper::GetDword(
L"Menu",
L"EnableDropShadow",
0
) &&
(effectType == 4 || effectType == 5)
)
{
EffectHelper::SetWindowBackdrop(window, TRUE, 0, 4);
}
}

menuHandler.HandleSysBorderColors(L"Menu"sv, window, info.useDarkMode, info.borderColor);
EffectHelper::EnableWindowDarkMode(window, info.useDarkMode);

Expand Down
2 changes: 1 addition & 1 deletion TFMain/Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace TranslucentFlyouts

static inline std::optional<wil::unique_rouninitialize_call> RoInit()
{
HRESULT hr{::RoInitialize(RO_INIT_MULTITHREADED)};
HRESULT hr{::RoInitialize(RO_INIT_SINGLETHREADED)};

if (SUCCEEDED(hr) || hr == S_FALSE)
{
Expand Down

0 comments on commit d5e725b

Please sign in to comment.